Bug#1059534: DEP17: handle /usr-move for gzip and its diversions by zutils

2024-03-08 Thread Daniel Baumann
On 3/8/24 15:28, Helmut Grohne wrote:
> $FILE needs to be used here.

thanks.

> I was about to NMU zutils. Can you move ahead soonish? Once zutils is
> uploaded, I can go ahead with gzip.

sure, will upload in ~3h from now.

Regards,
Daniel



Bug#1059534: DEP17: handle /usr-move for gzip and its diversions by zutils

2024-03-08 Thread Helmut Grohne
Hi Daniel,

On Fri, Mar 08, 2024 at 09:38:59AM +0100, Daniel Baumann wrote:
> Just to be sure - I think I've found a typo in the latest iteration of
> the patch, could you please confirm?
> 
> https://git.progress-linux.org/users/daniel.baumann/debian/packages/zutils/commit/?id=a4f81b9df9543f588c052861426469405603fb1d

I confirm that my last patch evidently is not correct and that the use
of $TOOL is wrong. Unfortunately, $TRUENAME is also wrong and $FILE
needs to be used here.

I was about to NMU zutils. Can you move ahead soonish? Once zutils is
uploaded, I can go ahead with gzip.

Helmut



Bug#1059534: DEP17: handle /usr-move for gzip and its diversions by zutils

2024-03-08 Thread Daniel Baumann
Hi Helmut,

thanks for the patch and work on this, much appreciated.

Just to be sure - I think I've found a typo in the latest iteration of
the patch, could you please confirm?

https://git.progress-linux.org/users/daniel.baumann/debian/packages/zutils/commit/?id=a4f81b9df9543f588c052861426469405603fb1d

Regards,
Daniel



Bug#1059534: DEP17: handle /usr-move for gzip and its diversions by zutils

2023-12-27 Thread Helmut Grohne
reassign 1059534 zutils
found 1059534 zutils/1.12-3
user helm...@debian.org
usertags 1059534 = dep17p3
thanks

On Wed, Dec 27, 2023 at 06:13:07PM +0100, Helmut Grohne wrote:
> For gzip the story is relatively simple. It moves all the files, but it
> must not be unpacked when there is a version of zutils installed that
> hasn't duplicated its diversions yet. The best we can do here is adding
> versioned Conflicts (not Breaks). I caution that this is not entirely
> bullet-proof. If you `echo zutils deinstall | dpkg --set-selections` and
> then `dpkg --unpack new_gzip.deb`, it'll unpack the moved gzip first and
> then remove zu old zutils that lacks the duplicated diversions. Even in
> this case, the gzip package would continue working after the upgrade.

Looking closer, it turns out my patch really wasn't moving stuff. I've
now updated the patch and could actually reproduce the loss as detailed
above. The updated patch includes a mitigation, but this only happens in
postinst. From unpack of gzip until gzip.postinst, some files may be
missing. This is a violation of Debian policy section 3.8. I fear there
is nothing we can do about this policy violation.

I note that while we will violate policy here, the violation is
time-limited (unpack gzip -> gzip.postinst) and there is no known way to
experience it unless interacting with dpkg directly. So anyone
performing the upgrade using apt (or aptitude or some graphical
frontend) will never experience this problem. I hope this is ok-ish.

> For zutils, the story is less easy. In order to avoid apt issuing a
> temporary removal of zutils (and thus trigger the wrongly ordered
> unpacks above), zutils must not issue versioned breaks for gzip and
> therefore it must carry the aliased diversions during the trixie cycle
> (and not just during the upgrade).
 
No change here.

> So I've developed these patches (both attached). Since piuparts doesn't
> deal well with testing essential packages, I've developed test cases
> using mmdebstrap (also attached) and performed the --set-selections test
> manually. Everything looks fine, but I keep the fingers crossed.

Tests rerun successfully.

> I ask you to upload these changes to experimental (not unstable). Once
> both updates are in experimental, dumat will be able to analyze and
> we'll also see what other kinds of QA says. Then once that works for
> both packages, we can upload zutils to unstable and then gzip.

Unchanged.

Sorry for the initially broken gzip patch.

Helmut
diff -Nru gzip-1.12/debian/changelog gzip-1.12/debian/changelog
--- gzip-1.12/debian/changelog  2022-04-10 04:22:26.0 +0200
+++ gzip-1.12/debian/changelog  2023-12-23 07:46:32.0 +0100
@@ -1,3 +1,10 @@
+gzip (1.12-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Move files to /usr (closes: #-1)
+
+ -- Helmut Grohne   Sat, 23 Dec 2023 07:46:32 +0100
+
 gzip (1.12-1) sid; urgency=high
 
   * new upstream release
diff -Nru gzip-1.12/debian/clean gzip-1.12/debian/clean
--- gzip-1.12/debian/clean  1970-01-01 01:00:00.0 +0100
+++ gzip-1.12/debian/clean  2023-12-23 07:46:32.0 +0100
@@ -0,0 +1 @@
+gzip.postinst
diff -Nru gzip-1.12/debian/control gzip-1.12/debian/control
--- gzip-1.12/debian/control2022-04-10 04:05:08.0 +0200
+++ gzip-1.12/debian/control2023-12-23 07:27:28.0 +0100
@@ -16,6 +16,7 @@
 Pre-Depends: ${shlibs:Depends}
 Depends: dpkg (>= 1.15.4) | install-info
 Suggests: less
+Conflicts: zutils (<< 1.12-3.1~)
 Description: GNU compression utilities
  This package provides the standard GNU file compression utilities, which
  are also the default compression tools for Debian.  They typically operate
diff -Nru gzip-1.12/debian/dirs gzip-1.12/debian/dirs
--- gzip-1.12/debian/dirs   2022-04-09 04:15:18.0 +0200
+++ gzip-1.12/debian/dirs   2023-12-23 07:46:32.0 +0100
@@ -1,3 +1,2 @@
-bin
 usr/share/info
 usr/share/man/man1
diff -Nru gzip-1.12/debian/gzip.postinst.gen gzip-1.12/debian/gzip.postinst.gen
--- gzip-1.12/debian/gzip.postinst.gen  1970-01-01 01:00:00.0 +0100
+++ gzip-1.12/debian/gzip.postinst.gen  2023-12-23 07:46:32.0 +0100
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+echo "#!/bin/sh"
+echo
+echo "set -e"
+echo
+# The following if block (and probably the entire maintainer script) can be
+# removed after trixie.
+echo 'if test "$1" = configure && test -n "$2"; then'
+
+for f in zcat zcmp zdiff zegrep zfgrep zgrep; do
+   echo "  if ! test -e /usr/bin/$f; then"
+   echo "cat >/usr/bin/$f <<'END_OF_SCRIPT'"
+   cat "debian/gzip/usr/bin/$f"
+   echo END_OF_SCRIPT
+   echo "chown 0:0 /usr/bin/$f"
+   echo "chmod 0755 /usr/bin/$f"
+   echo "  fi"
+done
+
+echo fi
+echo
+echo "#DEBHELPER#"
diff -Nru gzip-1.12/debian/rules gzip-1.12/debian/rules
--- gzip-1.12/debian/rules  2022-04-09 04:15:18.0 +0200
+++ gzip-1.12/debian/rules  2023-12-23 07:46:32.0 +0100
@@ -47,9 +47,9 @@
 _topdir=$(call