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.000000000 +0200
+++ gzip-1.12/debian/changelog  2023-12-23 07:46:32.000000000 +0100
@@ -1,3 +1,10 @@
+gzip (1.12-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Move files to /usr (closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  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.000000000 +0100
+++ gzip-1.12/debian/clean      2023-12-23 07:46:32.000000000 +0100
@@ -0,0 +1 @@
+gzip.postinst
diff -Nru gzip-1.12/debian/control gzip-1.12/debian/control
--- gzip-1.12/debian/control    2022-04-10 04:05:08.000000000 +0200
+++ gzip-1.12/debian/control    2023-12-23 07:27:28.000000000 +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.000000000 +0200
+++ gzip-1.12/debian/dirs       2023-12-23 07:46:32.000000000 +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.000000000 +0100
+++ gzip-1.12/debian/gzip.postinst.gen  2023-12-23 07:46:32.000000000 +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.000000000 +0200
+++ gzip-1.12/debian/rules      2023-12-23 07:46:32.000000000 +0100
@@ -47,9 +47,9 @@
 _topdir=$(call shellescape,$(shell pwd))
 
 CONFIGURE_ARGS=                --prefix=/usr \
-                       --bindir=/bin \
-                       --infodir=${_topdir}/debian/gzip/usr/share/info \
-                       --mandir=${_topdir}/debian/gzip/usr/share/man \
+                       --bindir=/usr/bin \
+                       --infodir=/usr/share/info \
+                       --mandir=/usr/share/man \
                        --disable-silent-rules
 
 ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
@@ -130,9 +130,7 @@
        dh_testroot
        dh_prep
        dh_installdirs
-       ${MAKE} -C builddir install \
-           prefix=${_topdir}/debian/gzip/usr \
-           bindir=${_topdir}/debian/gzip/bin
+       ${MAKE} -C builddir install DESTDIR=${_topdir}/debian/gzip
        dh_testdir -a
        dh_testroot -a
        dh_installdocs -a README* TODO NEWS
@@ -148,6 +146,7 @@
        ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zfgrep.1.gz
        rm -f ${_topdir}/debian/gzip/usr/share/info/dir.gz
        dh_fixperms -a
+       sh ./debian/gzip.postinst.gen > debian/gzip.postinst
        dh_makeshlibs -a
        dh_installdeb -a
        dh_shlibdeps -a

Reply via email to