This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=7c640c2fa89749dba447fedc33cee4e29c40ce1b

commit 7c640c2fa89749dba447fedc33cee4e29c40ce1b
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Sep 2 17:49:26 2023 +0200

    debian: Do not stop the dpkg-db-backup timer and service during upgrade
    
    We should not stop the service nor the timer otherwise they remain
    stopped after upgrade. But we have to explicitly tell systemd to do
    a daemon-reload because due to bug #932360 debhelper does not do it
    for us. For removal or purge this is already handled in those cases.
    
    Closes: #1051085
---
 debian/dpkg.postinst |  9 +++++++++
 debian/dpkg.postrm   | 12 ++++++++++++
 debian/rules         |  3 ++-
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/debian/dpkg.postinst b/debian/dpkg.postinst
index 867a9e692..3d8a74133 100644
--- a/debian/dpkg.postinst
+++ b/debian/dpkg.postinst
@@ -62,5 +62,14 @@ abort-upgrade|abort-deconfigure|abort-remove)
   ;;
 esac
 
+# Due to #932360 in debhelper we need to explicitly tell systemd to reload.
+case "$1" in
+configure|abort-upgrade|abort-deconfigure|abort-remove)
+  if [ -d /run/systemd/system ]; then
+    systemctl --system daemon-reload >/dev/null || true
+  fi
+  ;;
+esac
+
 #DEBHELPER#
 exit 0
diff --git a/debian/dpkg.postrm b/debian/dpkg.postrm
index 413341955..4d2acf472 100644
--- a/debian/dpkg.postrm
+++ b/debian/dpkg.postrm
@@ -11,6 +11,14 @@ remove_logfile() {
   rm -f "$logdir"/alternatives.log "$logdir"/alternatives.log.* 2>/dev/null
 }
 
+# Version 1.22.0 stopped the systemd timer, which meant it would not run
+# anymore.
+fixup_systemd_timer() {
+  if [ -d /run/systemd/system ]; then
+    deb-systemd-invoke restart 'dpkg-db-backup.timer' >/dev/null || true
+  fi
+}
+
 case "$1" in
 remove)
   ;;
@@ -18,6 +26,10 @@ purge)
   remove_logfile
   ;;
 upgrade)
+  if dpkg --compare-versions "$2" gt 1.22.0~ &&
+     dpkg --compare-versions "$2" le 1.22.1; then
+    fixup_systemd_timer
+  fi
   ;;
 failed-upgrade|disappear|abort-install|abort-upgrade)
   ;;
diff --git a/debian/rules b/debian/rules
index 8b86ca7ff..2a85fd1c3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -66,7 +66,8 @@ override_dh_auto_test:
        dh_auto_test -- $(testflags)
 
 override_dh_installsystemd:
-       dh_installsystemd -a --name=dpkg-db-backup --no-start
+       dh_installsystemd -a --name=dpkg-db-backup \
+         --no-start --no-stop-on-upgrade
 
 execute_after_dh_installlogrotate:
        dh_installlogrotate --name=alternatives

-- 
Dpkg.Org's dpkg

Reply via email to