Control: tags -1 + patch

Dear Maintainer,

Here is my patchset which re-enables and improves the cron scripts for
snapper, restoring scheduled snapshotting functionality on systems which
don't support systemd timers on account of using non-systemd init
systems.


This patchset can be applied to the debian packaging repository at
https://salsa.debian.org/debian/snapper.git using the git-am(1) command.


This patchset is composed of a few different parts.

The first part, patches 0001, 0002, and 0003, merely bring the
packaging repository up-to-date with respect to the two most recent
NMUs. Patches 0001 & 0002 bring the debian/sid branch up to
debian/0.10.6-1.1 and patch 0003 up to debian/0.10.6-1.2.

The second part, patches 1004 and 1005, revert two previous commits that
removed the cron scripts from the generated binary packages. This
removal was originally done as a quick fix for #791726.

The third part, patches 1006 and 1007, make two enhancements to the
cron scripts. 1006 adds a check early in the scripts that will cause
them to abort if the snapper binary is not found. This fixes the
original issue that prompted the filing of #791726. 1007 adds a similar
early check to the scripts that causes them to abort if systemd is
detected. This prevents the cron scripts running in addition to the
systemd timers on systemd-using systems.

Finally, the last part, patch 1008, updates the debian/changelog file.


Please let me know if you have any questions or if you would like me to
make any modifications and submit a v2 changeset.


Thanks,

-- 
Plasma
>From 8ce66a93c489886e8dc8d840714d94b9edc02484 Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergi...@debian.org>
Date: Sat, 3 Feb 2024 23:02:54 +0000
Subject: [PATCH 1/8] NMU diff for 64-bit time_t transition

---
 debian/changelog                                       | 7 +++++++
 debian/control                                         | 9 +++++----
 debian/{libsnapper7.install => libsnapper7t64.install} | 0
 debian/libsnapper7t64.lintian-overrides                | 1 +
 4 files changed, 13 insertions(+), 4 deletions(-)
 rename debian/{libsnapper7.install => libsnapper7t64.install} (100%)
 create mode 100644 debian/libsnapper7t64.lintian-overrides

diff --git a/debian/changelog b/debian/changelog
index c312a46..377fe07 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+snapper (0.10.6-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Rename libraries for 64-bit time_t transition.
+
+ -- Sergio Durigan Junior <sergi...@debian.org>  Sat, 03 Feb 2024 23:01:50 +0000
+
 snapper (0.10.6-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/debian/control b/debian/control
index 0cdaf5c..461888e 100644
--- a/debian/control
+++ b/debian/control
@@ -48,13 +48,14 @@ Description: Linux filesystem snapshot management tool
    * D-Bus interface
    * PAM module to create snapshots during login and logout (libpam-snapper)
 
-Package: libsnapper7
+Package: libsnapper7t64
+Provides: ${t64:Provides}
 Section: libs
 Architecture: linux-any
 Multi-Arch: same
 Depends: ${misc:Depends}, ${shlibs:Depends}
-Breaks: libsnapper6
-Replaces: libsnapper6
+Breaks: libsnapper7 (<< ${source:Version}), libsnapper6
+Replaces: libsnapper7, libsnapper6
 Description: Library for Linux filesystem snapshot management tool
  Snapper is a tool for Linux filesystem snapshot management. Apart from the
  obvious creation and deletion of snapshots, it can compare snapshots and revert
@@ -67,7 +68,7 @@ Description: Library for Linux filesystem snapshot management tool
 Package: libsnapper-dev
 Section: libdevel
 Architecture: linux-any
-Depends: ${misc:Depends}, libsnapper7 (= ${binary:Version})
+Depends: ${misc:Depends}, libsnapper7t64 (= ${binary:Version})
 Description: Library for Linux filesystem snapshot management tool (header files)
  Snapper is a tool for Linux filesystem snapshot management. Apart from the
  obvious creation and deletion of snapshots, it can compare snapshots and revert
diff --git a/debian/libsnapper7.install b/debian/libsnapper7t64.install
similarity index 100%
rename from debian/libsnapper7.install
rename to debian/libsnapper7t64.install
diff --git a/debian/libsnapper7t64.lintian-overrides b/debian/libsnapper7t64.lintian-overrides
new file mode 100644
index 0000000..aa2e9a8
--- /dev/null
+++ b/debian/libsnapper7t64.lintian-overrides
@@ -0,0 +1 @@
+libsnapper7t64: package-name-doesnt-match-sonames libsnapper7
-- 
2.30.2

>From 28a0f2e4f4939f659029879e657d1b55206a7bfd Mon Sep 17 00:00:00 2001
From: Benjamin Drung <bdr...@debian.org>
Date: Thu, 29 Feb 2024 16:56:55 +0000
Subject: [PATCH 2/8] upload to unstable

Closes: #1062906
---
 debian/changelog | 6 +++---
 debian/control   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 377fe07..f7e54f1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-snapper (0.10.6-1.1) UNRELEASED; urgency=medium
+snapper (0.10.6-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
-  * Rename libraries for 64-bit time_t transition.
+  * Rename libraries for 64-bit time_t transition.  Closes: #1062906
 
- -- Sergio Durigan Junior <sergi...@debian.org>  Sat, 03 Feb 2024 23:01:50 +0000
+ -- Benjamin Drung <bdr...@debian.org>  Thu, 29 Feb 2024 16:55:43 +0000
 
 snapper (0.10.6-1) unstable; urgency=medium
 
diff --git a/debian/control b/debian/control
index 461888e..96525bc 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: snapper
 Section: utils
 Priority: optional
 Maintainer: Hideki Yamane <henr...@debian.org>
-Build-Depends:
+Build-Depends: dpkg-dev (>= 1.22.5),
  libbtrfs-dev,
  debhelper-compat (= 13),
  docbook-xsl,
-- 
2.30.2

>From e8cae33d54b1f370b85f1b088b5d2c256f8729d3 Mon Sep 17 00:00:00 2001
From: Michael Biebl <bi...@debian.org>
Date: Tue, 10 Sep 2024 08:56:14 +0200
Subject: [PATCH 3/8] move aliased files from / to /usr (DEP17)

Closes: #1073699
---
 debian/changelog       | 7 +++++++
 debian/snapper.install | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index f7e54f1..466ce33 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+snapper (0.10.6-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Install systemd units into /usr. (Closes: #1073699)
+
+ -- Michael Biebl <bi...@debian.org>  Tue, 10 Sep 2024 08:48:47 +0200
+
 snapper (0.10.6-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --git a/debian/snapper.install b/debian/snapper.install
index 73b2f02..70ba8ab 100644
--- a/debian/snapper.install
+++ b/debian/snapper.install
@@ -9,7 +9,7 @@ etc/snapper
 /usr/share/snapper
 usr/lib/snapper/installation-helper 
 usr/lib/snapper/systemd-helper 
-usr/lib/systemd/system/*	lib/systemd/system/
+usr/lib/systemd/system
 debian/80snapper		etc/apt/apt.conf.d/
 usr/share/bash-completion/completions/snapper
 usr/share/zsh/site-functions/_snapper
-- 
2.30.2

>From 252748afb2c532e60e61037fa042e6a49c127f84 Mon Sep 17 00:00:00 2001
From: "Plasma (David Paul)" <davidp...@librem.one>
Date: Thu, 2 Jan 2025 12:40:02 -0600
Subject: [PATCH 4/8] Revert "remove cron files"

This reverts commit 6f45e4c0feb388e8b67011be4e7fa25be9046b90.
---
 debian/snapper.postinst | 12 ------------
 debian/snapper.postrm   | 12 ------------
 debian/snapper.preinst  | 12 ------------
 3 files changed, 36 deletions(-)
 delete mode 100644 debian/snapper.postinst
 delete mode 100644 debian/snapper.postrm
 delete mode 100644 debian/snapper.preinst

diff --git a/debian/snapper.postinst b/debian/snapper.postinst
deleted file mode 100644
index 040564e..0000000
--- a/debian/snapper.postinst
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case "$1" in
-install|upgrade)
-  if dpkg --compare-versions "$2" lt-nl 0.3.3-0.1; then
-    rm /etc/cron.daily/snapper /etc/cron.hourly/snapper || true
-  fi
-esac
-#DEBHELPER#
-exit 0
diff --git a/debian/snapper.postrm b/debian/snapper.postrm
deleted file mode 100644
index 040564e..0000000
--- a/debian/snapper.postrm
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case "$1" in
-install|upgrade)
-  if dpkg --compare-versions "$2" lt-nl 0.3.3-0.1; then
-    rm /etc/cron.daily/snapper /etc/cron.hourly/snapper || true
-  fi
-esac
-#DEBHELPER#
-exit 0
diff --git a/debian/snapper.preinst b/debian/snapper.preinst
deleted file mode 100644
index 040564e..0000000
--- a/debian/snapper.preinst
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case "$1" in
-install|upgrade)
-  if dpkg --compare-versions "$2" lt-nl 0.3.3-0.1; then
-    rm /etc/cron.daily/snapper /etc/cron.hourly/snapper || true
-  fi
-esac
-#DEBHELPER#
-exit 0
-- 
2.30.2

>From 7720a10cae9a8ffda2cacacd85b9f9a1ec00fa5b Mon Sep 17 00:00:00 2001
From: "Plasma (David Paul)" <davidp...@librem.one>
Date: Thu, 2 Jan 2025 12:58:12 -0600
Subject: [PATCH 5/8] Revert "fix #791726"

Closes: #976888

This reverts commit 8723f90fa2998b59d485b6ac1074e08f8aa6484f.
---
 debian/rules           | 8 ++++++--
 debian/snapper.install | 4 +---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/debian/rules b/debian/rules
index 9285363..49ace7a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -24,8 +24,12 @@ override_dh_auto_install:
 	mkdir -p $(CURDIR)/debian/tmp/etc/default
 	install -m 0644 $(CURDIR)/data/sysconfig.snapper $(CURDIR)/debian/tmp/etc/default/snapper
 
-	# temporary workaround: remove cronjob
-	rm -rf $(CURDIR)/debian/tmp/etc/cron*
+	# Change the cron names and config paths
+	set -e; for dir in $(CURDIR)/debian/tmp/etc/cron.*/; do \
+		sed -e 's#/etc/sysconfig#/etc/default#g' $$dir/suse.de-snapper > $$dir/snapper; \
+		chmod +x $$dir/snapper; \
+		rm $$dir/suse.de-snapper; \
+	done
 
 	# Purge the la files
 	find $(CURDIR)/debian/tmp -name *.la -delete
diff --git a/debian/snapper.install b/debian/snapper.install
index 70ba8ab..7ecb8a0 100644
--- a/debian/snapper.install
+++ b/debian/snapper.install
@@ -1,6 +1,4 @@
-etc/default/snapper
-etc/logrotate.d/snapper
-etc/snapper
+/etc
 /usr/bin
 /usr/sbin
 /usr/share/dbus-1
-- 
2.30.2

>From ba21cd4f1640ea2d111cbc88a982f04c726f4d54 Mon Sep 17 00:00:00 2001
From: "Plasma (David Paul)" <davidp...@librem.one>
Date: Sat, 25 Jan 2025 13:58:19 -0600
Subject: [PATCH 6/8] Make cronjobs abort if snapper is removed but not purged

(Re-)Closes: #791726
---
 debian/patches/cron-purge-fix.patch | 42 +++++++++++++++++++++++++++++
 debian/patches/series               |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 debian/patches/cron-purge-fix.patch

diff --git a/debian/patches/cron-purge-fix.patch b/debian/patches/cron-purge-fix.patch
new file mode 100644
index 0000000..78e3731
--- /dev/null
+++ b/debian/patches/cron-purge-fix.patch
@@ -0,0 +1,42 @@
+Description: Make cronjobs fail gracefully if snapper is removed but not purged
+ This re-fixes Debian bug #791726 without removing the cronjobs entirely.
+Author: Plasma (David Paul) <davidp...@librem.one>
+Bug-Debian: https://bugs.debian.org/791726
+Forwarded: not-needed
+Last-Update: 2025-01-25
+Index: snapper/scripts/snapper-daily
+===================================================================
+--- snapper.orig/scripts/snapper-daily
++++ snapper/scripts/snapper-daily
+@@ -1,5 +1,13 @@
+ #!/bin/sh
+ 
++#
++# skip if snapper is removed but not purged
++#
++if [ ! -x /usr/bin/snapper ] ; then
++    exit 0
++fi
++
++
+ #
+ # paranoia settings
+ #
+Index: snapper/scripts/snapper-hourly
+===================================================================
+--- snapper.orig/scripts/snapper-hourly
++++ snapper/scripts/snapper-hourly
+@@ -1,5 +1,13 @@
+ #!/bin/sh
+ 
++#
++# skip if snapper is removed but not purged
++#
++if [ ! -x /usr/bin/snapper ] ; then
++    exit 0
++fi
++
++
+ #
+ # paranoia settings
+ #
diff --git a/debian/patches/series b/debian/patches/series
index 549c728..48513af 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0004-fix-manpage.patch
 0005-drop-testsuite-real-to-avoid-to-be-installed-into-pa.patch
 0004-Add-some-missing-systemd-unit-directives.patch
+cron-purge-fix.patch
-- 
2.30.2

>From 1d799595fa8747825dec4ae32227b3d7552354f8 Mon Sep 17 00:00:00 2001
From: "Plasma (David Paul)" <davidp...@librem.one>
Date: Sat, 25 Jan 2025 14:06:03 -0600
Subject: [PATCH 7/8] Make cronjobs defer to systemd timers

---
 .../patches/cron-defer-to-systemd-timer.patch | 40 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 debian/patches/cron-defer-to-systemd-timer.patch

diff --git a/debian/patches/cron-defer-to-systemd-timer.patch b/debian/patches/cron-defer-to-systemd-timer.patch
new file mode 100644
index 0000000..abd53b0
--- /dev/null
+++ b/debian/patches/cron-defer-to-systemd-timer.patch
@@ -0,0 +1,40 @@
+Description: Make cronjobs defer to systemd timers
+Author: Plasma (David Paul) <davidp...@librem.one>
+Forwarded: no
+Last-Update: 2025-01-25
+Index: snapper/scripts/snapper-daily
+===================================================================
+--- snapper.orig/scripts/snapper-daily
++++ snapper/scripts/snapper-daily
+@@ -1,5 +1,13 @@
+ #!/bin/sh
+ 
++#
++# skip in favour of systemd timer
++#
++if [ -d /run/systemd/system ] ; then
++    exit 0
++fi
++
++
+ #
+ # skip if snapper is removed but not purged
+ #
+Index: snapper/scripts/snapper-hourly
+===================================================================
+--- snapper.orig/scripts/snapper-hourly
++++ snapper/scripts/snapper-hourly
+@@ -1,5 +1,13 @@
+ #!/bin/sh
+ 
++#
++# skip in favour of systemd timer
++#
++if [ -d /run/systemd/system ] ; then
++    exit 0
++fi
++
++
+ #
+ # skip if snapper is removed but not purged
+ #
diff --git a/debian/patches/series b/debian/patches/series
index 48513af..8b051f2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 0005-drop-testsuite-real-to-avoid-to-be-installed-into-pa.patch
 0004-Add-some-missing-systemd-unit-directives.patch
 cron-purge-fix.patch
+cron-defer-to-systemd-timer.patch
-- 
2.30.2

>From 1c7a242f93686968fd84938ac0484a17b232ea9a Mon Sep 17 00:00:00 2001
From: "Plasma (David Paul)" <davidp...@librem.one>
Date: Mon, 27 Jan 2025 14:10:38 -0600
Subject: [PATCH 8/8] Update changelog

---
 debian/changelog | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 466ce33..8c2f5af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+snapper (0.10.6-1.3) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Restore and enhance cron scripts.
+    Closes: #976888
+    Ref: #791726
+
+ -- Plasma (David Paul) <davidp...@librem.one>  Mon, 27 Jan 2025 14:09:41 -0600
+
 snapper (0.10.6-1.2) unstable; urgency=medium
 
   * Non-maintainer upload.
-- 
2.30.2

Reply via email to