From 5ca212130ac121ece5f22f82c8b2aab5d56fdcf6 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 27 Mar 2022 01:06:03 +0100 Subject: [PATCH] Fix the apt hook --- data/dpkg/apt.conf.d/99nymea | 7 ------- debian/nymead.install.in | 1 - debian/nymead.postinst | 7 +++++++ debian/{nymead.postrm => nymead.prerm} | 1 - 4 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 data/dpkg/apt.conf.d/99nymea rename debian/{nymead.postrm => nymead.prerm} (99%) diff --git a/data/dpkg/apt.conf.d/99nymea b/data/dpkg/apt.conf.d/99nymea deleted file mode 100644 index d85a9b2f..00000000 --- a/data/dpkg/apt.conf.d/99nymea +++ /dev/null @@ -1,7 +0,0 @@ -# nymea hook to restart nymead after upgrades that change nymea plugins or libraries - -DPkg::Pre-Install-Pkgs {"/usr/libexec/nymea-upgrade-helper"; }; -DPkg::Tools::Options::/usr/libexec/nymea-upgrade-helper::Version "1"; - -DPkg::Post-Invoke {"if [ -e /tmp/nymea-restart-pending ]; then systemctl restart nymead; rm /tmp/nymea-restart-pending; fi"; }; - diff --git a/debian/nymead.install.in b/debian/nymead.install.in index 2fe928e4..60d6ea4d 100644 --- a/debian/nymead.install.in +++ b/debian/nymead.install.in @@ -5,5 +5,4 @@ usr/lib/@DEB_HOST_MULTIARCH@/libnymea-core.so.1.0.0 data/systemd/nymead.service /lib/systemd/system/ data/logrotate/nymead /etc/logrotate.d/ data/dbus-1/io.guh.nymead.conf /etc/dbus-1/system.d/ -data/dpkg/apt.conf.d/99nymea /etc/apt/apt.conf.d/ data/dpkg/nymea-upgrade-helper /usr/libexec/ diff --git a/debian/nymead.postinst b/debian/nymead.postinst index 9aeb59f6..9f3d0304 100755 --- a/debian/nymead.postinst +++ b/debian/nymead.postinst @@ -29,6 +29,13 @@ else echo "Failed to set raw socket network capabilities for nymead. Network device discovery will not be available for non root users." fi +# nymea hook to restart nymead after upgrades that change nymea plugins or libraries +cat < /etc/apt/apt.conf.d/99nymea +DPkg::Pre-Install-Pkgs {"/usr/libexec/nymea-upgrade-helper"; }; +DPkg::Tools::Options::/usr/libexec/nymea-upgrade-helper::Version "1"; +DPkg::Post-Invoke {"if [ -e /tmp/nymea-restart-pending ]; then systemctl restart nymead; rm /tmp/nymea-restart-pending; fi"; }; +EOF + #DEBHELPER# exit 0 diff --git a/debian/nymead.postrm b/debian/nymead.prerm similarity index 99% rename from debian/nymead.postrm rename to debian/nymead.prerm index 6364fad9..02fc2b69 100644 --- a/debian/nymead.postrm +++ b/debian/nymead.prerm @@ -22,7 +22,6 @@ # apt remove doesn't remove files from /etc unless --purge is given # but we want to remove /etc/apt/apt.conf.d/99nymea in any case - rm /etc/apt/apt.conf.d/99nymea #DEBHELPER#