diff --git a/debian/qubes-core-agent.postinst b/debian/qubes-core-agent.postinst index b23c8ce..c240188 100644 --- a/debian/qubes-core-agent.postinst +++ b/debian/qubes-core-agent.postinst @@ -1,17 +1,24 @@ -# ensure that hostname resolves to 127.0.1.1 resp. ::1 and that /etc/hosts is -# in the form expected by qubes-sysinit.sh -for ip in '127\.0\.1\.1' '::1'; do - if grep -q "^${ip}\(\s\|$\)" /etc/hosts; then - sed -i "/^${ip}\s/,+0s/\(\s`hostname`\)\+\(\s\|$\)/\2/g" /etc/hosts - sed -i "s/^${ip}\(\s\|$\).*$/\0 `hostname`/" /etc/hosts - else - echo "${ip} `hostname`" >> /etc/hosts - fi -done -# remove hostname from 127.0.0.1 line (in debian the hostname is by default -# resolved to 127.0.1.1) -sed -i "/^127\.0\.0\.1\s/,+0s/\(\s`hostname`\)\+\(\s\|$\)/\2/g" /etc/hosts +#!/bin/bash -chown user:user /home_volatile/user +if [ "$0" == configure ]; then + # ensure that hostname resolves to 127.0.1.1 resp. ::1 and that /etc/hosts is + # in the form expected by qubes-sysinit.sh + for ip in '127\.0\.1\.1' '::1'; do + if grep -q "^${ip}\(\s\|$\)" /etc/hosts; then + sed -i "/^${ip}\s/,+0s/\(\s`hostname`\)\+\(\s\|$\)/\2/g" /etc/hosts + sed -i "s/^${ip}\(\s\|$\).*$/\0 `hostname`/" /etc/hosts + else + echo "${ip} `hostname`" >> /etc/hosts + fi + done + # remove hostname from 127.0.0.1 line (in debian the hostname is by default + # resolved to 127.0.1.1) + sed -i "/^127\.0\.0\.1\s/,+0s/\(\s`hostname`\)\+\(\s\|$\)/\2/g" /etc/hosts + + chown user:user /home_volatile/user +fi + +echo "Updating Qubes AppMenu." +/usr/lib/qubes/qubes-trigger-sync-appmenus.sh #DEBHELPER# diff --git a/debian/triggers b/debian/triggers new file mode 100644 index 0000000..aa950b6 --- /dev/null +++ b/debian/triggers @@ -0,0 +1 @@ +interest-noawait /usr/share/applications diff --git a/misc/qubes-trigger-sync-appmenus.sh b/misc/qubes-trigger-sync-appmenus.sh index 453100e..48f6024 100755 --- a/misc/qubes-trigger-sync-appmenus.sh +++ b/misc/qubes-trigger-sync-appmenus.sh @@ -1,6 +1,6 @@ #!/bin/sh -UPDATEABLE=`/usr/bin/xenstore-read qubes-vm-updateable` +UPDATEABLE=`xenstore-read qubes-vm-updateable` if [ "$UPDATEABLE" = "True" ]; then /usr/lib/qubes/qrexec-client-vm dom0 qubes.SyncAppMenus /bin/sh /etc/qubes-rpc/qubes.GetAppmenus