Your message dated Thu, 14 Mar 2024 17:49:09 +0000
with message-id <[email protected]>
and subject line Bug#1059533: fixed in gzip 1.12-1.1
has caused the Debian Bug report #1059533,
regarding DEP17: handle /usr-move for gzip and its diversions by zutils
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1059533: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1059533
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: gzip
Version: 1.12-1
User: [email protected]
Usertags: dep17m2
Tags: patch
Control: clone -1 -2
Control: reassign -2 zutils/1.12-3
Control: block -1 by -2

Hi,

as part of DEP17, I am looking into moving aliased files in essential
packages from / to /usr. gzip is one such package. Unfortunately, moving
its files from / to /bin causes breakage. zutils diverts e.g. /bin/zcmp
and once gzip moves that to /usr/bin/zcmp, the diversions issued by
zutils become ineffective (DEP17 P3) causing unintended file overwrites.

Mitigating these has turned out to be non-trival and I think we now have
a good understanding of the edge cases having gone through them with
molly-guard. I propose duplicating diversions (DEP17 M18) here as well.

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.

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).

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.

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.

Thanks for your cooperation

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 <[email protected]>  Sat, 23 Dec 2023 07:46:32 +0100
+
 gzip (1.12-1) sid; urgency=high
 
   * new upstream release
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/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:26:46.000000000 +0100
@@ -47,7 +47,7 @@
 _topdir=$(call shellescape,$(shell pwd))
 
 CONFIGURE_ARGS=                --prefix=/usr \
-                       --bindir=/bin \
+                       --bindir=/usr/bin \
                        --infodir=${_topdir}/debian/gzip/usr/share/info \
                        --mandir=${_topdir}/debian/gzip/usr/share/man \
                        --disable-silent-rules
diff -Nru zutils-1.12/debian/changelog zutils-1.12/debian/changelog
--- zutils-1.12/debian/changelog        2023-06-16 11:37:05.000000000 +0200
+++ zutils-1.12/debian/changelog        2023-12-23 07:46:00.000000000 +0100
@@ -1,3 +1,10 @@
+zutils (1.12-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * DEP17 M18: Duplicate aliased diversions (Closes: #-1).
+
+ -- Helmut Grohne <[email protected]>  Sat, 23 Dec 2023 07:46:00 +0100
+
 zutils (1.12-3) sid; urgency=medium
 
   * Uploading to sid.
diff -Nru zutils-1.12/debian/rules zutils-1.12/debian/rules
--- zutils-1.12/debian/rules    2023-06-13 08:08:48.000000000 +0200
+++ zutils-1.12/debian/rules    2023-12-23 07:46:00.000000000 +0100
@@ -6,7 +6,7 @@
        dh ${@}
 
 override_dh_auto_configure:
-       dh_auto_configure -- --exec-prefix=/ CXX=$(CXX)
+       dh_auto_configure -- CXX=$(CXX)
 
 override_dh_auto_install:
        dh_auto_install -- DESTDIR=$(CURDIR)/debian/zutils
diff -Nru zutils-1.12/debian/zutils.postrm zutils-1.12/debian/zutils.postrm
--- zutils-1.12/debian/zutils.postrm    2023-06-13 08:08:48.000000000 +0200
+++ zutils-1.12/debian/zutils.postrm    2023-12-23 07:45:29.000000000 +0100
@@ -6,7 +6,8 @@
        remove)
                for FILE in zcat zcmp zdiff zegrep zfgrep zgrep
                do
-                       dpkg-divert --package zutils --quiet --remove --rename 
--divert /bin/${FILE}.gzip /bin/${FILE}
+                       dpkg-divert --package zutils --quiet --remove --rename 
--divert "/usr/bin/$FILE.gzip" "/usr/bin/$FILE"
+                       dpkg-divert --package zutils --quiet --remove --rename 
--divert "/bin/$FILE.gzip.usr-is-merged" "/bin/$FILE"
                        dpkg-divert --package zutils --quiet --remove --rename 
--divert /usr/share/man/man1/${FILE}.gzip.1.gz /usr/share/man/man1/${FILE}.1.gz
                done
                ;;
diff -Nru zutils-1.12/debian/zutils.preinst zutils-1.12/debian/zutils.preinst
--- zutils-1.12/debian/zutils.preinst   2023-06-13 08:08:48.000000000 +0200
+++ zutils-1.12/debian/zutils.preinst   2023-12-23 07:46:00.000000000 +0100
@@ -2,15 +2,32 @@
 
 set -e
 
+# DEP17 M18: Duplicate diversion in aliased location /bin.
+
 case "${1}" in
        install)
                for FILE in zcat zcmp zdiff zegrep zfgrep zgrep
                do
-                       dpkg-divert --package zutils --quiet --add --rename 
--divert /bin/${FILE}.gzip /bin/${FILE}
+                       dpkg-divert --package zutils --quiet --add --rename 
--divert "/usr/bin/$FILE.gzip.usr-is-merged" "/usr/bin/$FILE"
+                       dpkg-divert --package zutils --quiet --add --rename 
--divert "/bin/$FILE.gzip.usr-is-merged" "/bin/$FILE"
                        dpkg-divert --package zutils --quiet --add --rename 
--divert /usr/share/man/man1/${FILE}.gzip.1.gz /usr/share/man/man1/${FILE}.1.gz
                done
                ;;
 
+       upgrade)
+               for FILE in zcat zcmp zdiff zegrep zfgrep zgrep
+               do
+                       TRUENAME=$(dpkg-divert --truename "/bin/$FILE")
+                       dpkg-divert --package zutils --quiet --add --no-rename 
--divert "/usr/bin/$FILE.gzip" "/usr/bin/$FILE"
+                       if test "$TRUENAME" != "/bin/$FILE.gzip.usr-is-merged"; 
then
+                               dpkg-divert --package zutils --quiet --remove 
--no-rename "/bin/$FILE"
+                               dpkg-divert --package zutils --quiet --add 
--no-rename --divert "/bin/$FILE.gzip.usr-is-merged" "/bin/$FILE"
+                               if test -e "$DPKG_ROOT$TRUENAME" -o -h 
"$DPKG_ROOT$TRUENAME"; then
+                                       mv "$DPKG_ROOT$TRUENAME" 
"$DPKG_ROOT/bin/$FILE.gzip.usr-is-merged"
+                               fi
+                       fi
+               done
+               ;;
        abort-upgrade|upgrade)
 
                ;;

Attachment: testcase.sh
Description: Bourne shell script

TESTS= \
        -_gzip \
        -_zutils \
        -_gzip-zutils \
        zutils_zutils \
        newzutils_gzip \
        newzutils_rmzutils \
        newgzip_zutils \
        newgzip-newzutils_rmzutils \

all: $(foreach t,$(TESTS),testout/$(t))

testout/%:
        ./testcase.sh "$(firstword $(subst _, ,$*))" "$(lastword $(subst _, 
,$*))" >"$@" 2>&1; echo $$? >> "$@"

--- End Message ---
--- Begin Message ---
Source: gzip
Source-Version: 1.12-1.1
Done: Helmut Grohne <[email protected]>

We believe that the bug you reported is fixed in the latest version of
gzip, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Helmut Grohne <[email protected]> (supplier of updated gzip package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 09 Mar 2024 18:04:58 +0100
Source: gzip
Architecture: source
Version: 1.12-1.1
Distribution: sid
Urgency: medium
Maintainer: Milan Kupcevic <[email protected]>
Changed-By: Helmut Grohne <[email protected]>
Closes: 1059533
Changes:
 gzip (1.12-1.1) sid; urgency=medium
 .
   * Non-maintainer upload.
   * Move files to /usr (closes: #1059533)
Checksums-Sha1:
 1f30a8896b3f3a8a7672a508efa993f77797aae1 2167 gzip_1.12-1.1.dsc
 cb176abde2d6eed50f93c0fb3a52e7a461215309 19244 gzip_1.12-1.1.debian.tar.xz
 b3302c621f52b149d28863efaafe849de5d801f8 7532 gzip_1.12-1.1_amd64.buildinfo
Checksums-Sha256:
 212bff0edd2ccbbf816d7168f46f81d714b57043c249411e2e2d0fd71c3d3e40 2167 
gzip_1.12-1.1.dsc
 d48d5314c0255114f43964f78b87262299bbac840e5f511a078e2d2590937ad6 19244 
gzip_1.12-1.1.debian.tar.xz
 0b03a3fa378fe53a334538cd6e182c9ddf3baa7e145e9ec46ddacd16f36238ab 7532 
gzip_1.12-1.1_amd64.buildinfo
Files:
 15fd5cdc5862481a94adada2f3ba1c38 2167 utils required gzip_1.12-1.1.dsc
 1fd7f2ed0c4542b40ac66a2193e77bf9 19244 utils required 
gzip_1.12-1.1.debian.tar.xz
 909139d4f2e35e6141876523f717231b 7532 utils required 
gzip_1.12-1.1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEETMLS2QqNFlTb+HOqLRqqzyREREIFAmXsmGAACgkQLRqqzyRE
REJNxA/+JCIuKDCLUK1q4rw0Wf9I3GFEGKW8ajm3HS8myHpvbStO7AFqFeBFJ5ky
gLPDNVsKEM6LOSeKyrwhEi+MpRggEhqPBBg7SuD1BE+bOWgC3F0t7IvYRvNyuTX9
MFkxlVdWVpgh5dML8XFjkOWZsqbszGeZBX9wXgM0WNy3io48oof4d2TquhwIwXhT
p1oVduI5WpeWWWI64vYH129NBVdVl6C2epvpisC1YkeptcY6C9kRIifLoejw8L2d
pBfiZR1/gjE6gI0aTKVYnyvDJW+4W4PUXZuC+iWY2G0GvEChagwth4F3IeSceTCY
+/XoInjhPg1MB8js+txlXBLiTxAWDOhx3E+DiC6XOGSf6F3JWZKcuodopD4+0NQ7
MJRLgzPJGAWPG9VDzKEhnGr8kPn78eolCvvMirySBHwXus9NhYPTI2WXeCOI/AYR
jdF3mye1HPGxMW+if60tUVY1oqY8oGdTkNCuEiDxK1HaHwBvesv9zuPyRE8RMfCa
MwOFSxt9bccUZrxGbATfKmJoj9BHzXWpSYtFvwgPowVhigszrA8sQFwVczsh5cYX
BNA/v23SAyANBf9XpEIAe+gchVHJwtIbRXJ4BnIrDZxEnWJeZ+p/s+QU2ZcpsvVw
rDUFOBF2mPRTwxArPZ+1Nx/fjyNMRI7tRFh0F39qvtE+ebj1wyw=
=rAak
-----END PGP SIGNATURE-----

Attachment: pgpg9FX7g_spx.pgp
Description: PGP signature


--- End Message ---

Reply via email to