Control: tags -1 + pending

Hi Andrea,

I am moving forward with NMUing opensysusers. I am aware that you prefer
a more elaborate solution that involves splitting opensysusers. However,
this is an RC-bug with a patch and thus eligible for 0-day NMU according
to devref. opensysusers will not have RC bugs and it will pass
autopkgtests (due to applying Michael's patch). As a result,
opensysusers should migrate to trixie. My understanding is that this
upload does not regress opensysusers in any way (as the Conflict is
already present on the systemd side) and it is more of a band-aid until
a better solution evolves. As far as I understand your splitting plan,
you want to do away with diversions and therefore I expect that my
upload does not impede your better solution. For now, I hope we agree
that opensysusers stops having RC bugs and becomes part of trixie even
if it does not have all of the capabilities that you'd like it to have.
I earlier offered support with examining compatibility with /usr-move of
your solution and I continue offering that. NMUed patches attached.

Helmut
>From 04b5cfb33c8af37d00e8dff278972621ae6c227a Mon Sep 17 00:00:00 2001
From: Helmut Grohne <hel...@subdivi.de>
Date: Sun, 26 Jan 2025 13:26:47 +0100
Subject: [PATCH 1/3] Declare Conflicts: systemd-sysusers and remove
 diversions.

This is not the solution Andrea prefers, but all other systemd-sysusers
implementations presently conflict with opensysusers. Andrea also wants
to get rid of the diversions, but the sketched approach is splitting the
package. Removing the diversions here does not impede his plans, but it
does fix the /usr-move fallout. The declared Conflicts can be reverted
once a better solution is available.

Closes: #1092745
---
 debian/.gitignore            |  5 +++++
 debian/control               |  2 ++
 debian/opensysusers.postinst | 16 ++++++++++++++++
 debian/opensysusers.postrm   | 32 --------------------------------
 debian/opensysusers.preinst  | 18 ------------------
 5 files changed, 23 insertions(+), 50 deletions(-)
 create mode 100644 debian/opensysusers.postinst
 delete mode 100644 debian/opensysusers.postrm

diff --git a/debian/.gitignore b/debian/.gitignore
index 68c9369..e3ff0b6 100644
--- a/debian/.gitignore
+++ b/debian/.gitignore
@@ -2,5 +2,10 @@
 debhelper-build-stamp
 files
 opensysusers.*
+!opensysusers.init
+!opensysusers.links
+!opensysusers.lintian-overrides
+!opensysusers.preinst
+!opensysusers.postinst
 opensysusers/*
 
diff --git a/debian/control b/debian/control
index 7bc327d..68c9f4f 100644
--- a/debian/control
+++ b/debian/control
@@ -17,6 +17,8 @@ X-Style: black
 Package: opensysusers
 Provides:
  systemd-sysusers,
+Conflicts:
+ systemd-sysusers,
 Architecture: all
 Depends:
  passwd,
diff --git a/debian/opensysusers.postinst b/debian/opensysusers.postinst
new file mode 100644
index 0000000..f68defc
--- /dev/null
+++ b/debian/opensysusers.postinst
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+if [ configure = "$1" ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt 0.7.3-4.1~; then
+    # We are upgrading from an earlier version that used to divert
+    # systemd-sysusers. Since this version Conflicts: systemd-sysusers, there
+    # should not be any divertees left during postinst and we may safely remove
+    # all remaining diversions. If anything is left behind, --rename will fail.
+    dpkg-divert --remove --rename /usr/bin/systemd-sysusers
+    dpkg-divert --remove --rename /bin/systemd-sysusers
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/opensysusers.postrm b/debian/opensysusers.postrm
deleted file mode 100644
index 0bf2d47..0000000
--- a/debian/opensysusers.postrm
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "remove" ] || [ "$1" = "abort-install" ] || [ "$1" = "disappear" ] ; then
-	dpkg-divert --package opensysusers --remove --no-rename \
-        --divert /bin/systemd-sysusers.real /bin/systemd-sysusers
-	dpkg-divert --package opensysusers --remove --no-rename \
-	--divert /usr/bin/systemd-sysusers.real /usr/bin/systemd-sysusers
-fi
-
-if [ "abort-upgrade" = "$1" ] && dpkg --compare-versions "$2" lt 0.6-1; then
-	dpkg-divert --package opensysusers --remove --no-rename \
-        --divert /bin/systemd-sysusers.real /bin/systemd-sysusers
-fi
-
-if [ "$1" = abort-upgrade ] && dpkg --compare-versions "$2" lt 0.7.3-2.1~; then
-	dpkg-divert --package opensysusers --remove --no-rename \
-	--divert /usr/bin/systemd-sysusers.real /usr/bin/systemd-sysusers
-fi
-
-if [ "$1" = "remove" ] || [ "$1" = "abort-install" ] || [ "$1" = "disappear" ] ; then
-	for f in /usr/bin/systemd-sysusers /bin/systemd-sysusers; do
-		if [ -e "$DPKG_ROOT$f.real" ] && ! [ -e "$DPKG_ROOT$f" ]; then
-			mv "$DPKG_ROOT$f.real" "$DPKG_ROOT$f"
-		fi
-	done
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/opensysusers.preinst b/debian/opensysusers.preinst
index 6cea9eb..0d10851 100644
--- a/debian/opensysusers.preinst
+++ b/debian/opensysusers.preinst
@@ -6,24 +6,6 @@ if [ upgrade = "$1" ] && dpkg --compare-versions "$2" lt 0.6-1; then
 	update-alternatives --remove-all sysusers
 fi
 
-if [ upgrade != "$1" ] || dpkg --compare-versions "$2" lt 0.6-1; then
-    dpkg-divert --package opensysusers --add --no-rename \
-        --divert /bin/systemd-sysusers.real /bin/systemd-sysusers
-fi
-
-if [ upgrade != "$1" ] || dpkg --compare-versions "$2" lt 0.7.3-2.1~; then
-    dpkg-divert --package opensysusers --add --no-rename \
-	--divert /usr/bin/systemd-sysusers.real /usr/bin/systemd-sysusers
-fi
-
-if [ upgrade != "$1" ]; then
-    for f in /usr/bin/systemd-sysusers /bin/systemd-sysusers; do
-        if [ -e "$DPKG_ROOT$f" ] && ! [ -e "$DPKG_ROOT$f.real" ]; then
-            mv "$DPKG_ROOT$f" "$DPKG_ROOT$f.real"
-        fi
-    done
-fi
-
 #DEBHELPER#
 
 exit 0
-- 
2.47.2

>From 6f5fe57f125a0e32e5fb2e68931ea96068e6be5d Mon Sep 17 00:00:00 2001
From: Michael Biebl <mbi...@debian.org>
Date: Sun, 26 Jan 2025 13:38:45 +0100
Subject: [PATCH 2/3] Run autopkgtest without installing

Doing so fixes the autopkgtest as long as systemd conflicts with
opensysusers. Andrea has other plans and should revert this change once
a better solution is available.
---
 debian/tests/control | 3 +--
 debian/tests/root    | 2 +-
 debian/tests/run     | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/debian/tests/control b/debian/tests/control
index c2e5df6..5fe207f 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -2,7 +2,6 @@ Tests:
  run,
 Depends:
  passwd,
- @,
 Restrictions:
  breaks-testbed,
  needs-root,
@@ -10,4 +9,4 @@ Restrictions:
 Tests:
  root,
 Depends:
- @,
+ passwd,
diff --git a/debian/tests/root b/debian/tests/root
index 5d4fa5b..4328356 100644
--- a/debian/tests/root
+++ b/debian/tests/root
@@ -11,7 +11,7 @@ then
 	exit 1
 fi
 
-PATH="$PATH:/usr/sbin" systemd-sysusers --root="$AUTOPKGTEST_TMP/root" --inline 'u opensysusers-test-root - - - -'
+PATH="$PATH:/usr/sbin" ./sysusers --root="$AUTOPKGTEST_TMP/root" --inline 'u opensysusers-test-root - - - -'
 
 grep opensysusers-test-root "$AUTOPKGTEST_TMP/root/etc/passwd"
 
diff --git a/debian/tests/run b/debian/tests/run
index 18a4e5e..baa3bec 100644
--- a/debian/tests/run
+++ b/debian/tests/run
@@ -8,6 +8,6 @@ then
 	exit 1
 fi
 
-systemd-sysusers --inline 'u opensysusers-test-run - - - -'
+./sysusers --inline 'u opensysusers-test-run - - - -'
 
 passwd --status opensysusers-test-run
-- 
2.47.2

>From e0b7c823be2d27a08941c14ed3cab329441801a4 Mon Sep 17 00:00:00 2001
From: Helmut Grohne <hel...@subdivi.de>
Date: Sun, 26 Jan 2025 13:42:06 +0100
Subject: [PATCH 3/3] nmu 0.7.3-4.1 to unstable

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

diff --git a/debian/changelog b/debian/changelog
index 7193dfb..f5524ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+opensysusers (0.7.3-4.1) unstable; urgency=medium
+
+  [ Helmut Grohne ]
+  * Non-maintainer upload.
+  * Declare Conflicts: systemd-sysusers and remove diversions.
+    (Closes: #1092745)
+
+  [ Michael Biebl ]
+  * Run autopkgtest without installing
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 26 Jan 2025 13:41:22 +0100
+
 opensysusers (0.7.3-4) unstable; urgency=medium
 
   * d/changelog: correct closed bug for previous entry
-- 
2.47.2

Reply via email to