Your message dated Thu, 16 Jan 2025 06:04:14 +0000
with message-id <e1tyizg-00ceed...@fasolo.debian.org>
and subject line Bug#1092955: fixed in bfh-metapackages 20211009-32
has caused the Debian Bug report #1092955,
regarding bfh-metapackages: incorrect --rename flags in duplicated diversions
(DEP17)
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 ow...@bugs.debian.org
immediately.)
--
1092955: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1092955
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: bfh-container
Version: 20211009-31
Severity: serious
Tags: patch
User: helm...@debian.org
Usertags: dep17
Hi,
I'm sorry to tell you that I still got the duplicated diversions wrong.
The full story is at
https://lists.debian.org/debian-devel/2025/01/msg00125.html. In any
case, I managed to reproduce bad scenarios for bfh-container. The main
issue here is that --rename may be specified for the canonicalized
diversion when the actual file is aliased and then it may be renamed in
a bad way making dpkg unhappy. Additionally, the order of diversions was
wrong as diversion targets must not overlap. Adding the canonicalized
diversion was failing as the aliased diversion had not yet changed its
target.
I'm attaching a patch that fixes both and also attaching my test cases
(that are all passing now). I added more comments such that the mess
becomes easier to understand by my future self and others.
Helmut
diff --minimal -Nru bfh-metapackages-20211009/debian/bfh-container.preinst
bfh-metapackages-20211009/debian/bfh-container.preinst
--- bfh-metapackages-20211009/debian/bfh-container.preinst 2024-12-12
18:01:16.000000000 +0100
+++ bfh-metapackages-20211009/debian/bfh-container.preinst 2025-01-13
12:35:28.000000000 +0100
@@ -8,26 +8,22 @@
for FILE in halt poweroff reboot shutdown coldreboot
do
- TRUENAME_USR="$(dpkg-divert --truename
"/usr/sbin/${FILE}")"
- TRUENAME_ALIAS="$(dpkg-divert --truename
"/sbin/${FILE}")"
- RENAME_FLAG="--no-rename"
- if [ "${TRUENAME_USR}" = "/usr/sbin/${FILE}" ]
+ # DEP17 M18 duplicated diversion, can be removed after
trixie.
+ RENAME_FLAG="--no-rename"
+ TRUENAME_ALIAS="$(dpkg-divert --truename
"/sbin/${FILE}")"
+ if [ "${TRUENAME_ALIAS}" = "/sbin/${FILE}" ]
then
- if [ "${TRUENAME_ALIAS}" = "/sbin/${FILE}" ]
+ # Rename if the file is presently installed as
aliased.
+ if dpkg -S "/sbin/${FILE}" 2>/dev/null | grep
-q "^[^ ]*: /sbin/${FILE}$"
then
RENAME_FLAG="--rename"
fi
- dpkg-divert --package bfh-container --quiet
--add "${RENAME_FLAG}" --divert "/usr/lib/container/divert/${FILE}.orig"
"/usr/sbin/${FILE}"
- fi
-
- # DEP17 M18 duplicated diversion, can be removed after
trixie.
- if [ "${TRUENAME_ALIAS}" = "/sbin/${FILE}" ]
- then
dpkg-divert --package bfh-container --quiet
--add "${RENAME_FLAG}" --divert
"/lib/container/divert/${FILE}.orig.usr-is-merged" "/sbin/${FILE}"
elif [ "${TRUENAME_ALIAS}" !=
"/lib/container/divert/${FILE}.orig.usr-is-merged" ]
then
+ # Change the diversion target. Must be done
before adding the canonicalized diversion below.
dpkg-divert --package bfh-container --quiet
--remove --no-rename "/sbin/${FILE}"
dpkg-divert --package bfh-container --quiet
--add --no-rename --divert "/lib/container/divert/${FILE}.orig.usr-is-merged"
"/sbin/${FILE}"
@@ -36,6 +32,10 @@
mv "${TRUENAME_ALIAS}"
"/lib/container/divert/${FILE}.orig.usr-is-merged"
fi
fi
+
+ # We may rename unconditionally here. If the file is
aliased, the earlier --rename will have moved it.
+ dpkg-divert --package bfh-container --quiet --add
--rename --divert "/usr/lib/container/divert/${FILE}.orig" "/usr/sbin/${FILE}"
+
done
for FILE in pm-hibernate pm-suspend pm-suspend-hybrid
@@ -44,6 +44,7 @@
if [ "${TRUENAME_USR}" =
"/lib/container/divert/${FILE}.orig" ]
then
+ # Update diversion target from aliased to
canonical.
dpkg-divert --package bfh-container --quiet
--remove --no-rename "/usr/sbin/${FILE}"
dpkg-divert --package bfh-container --quiet
--add --no-rename --divert "/usr/lib/container/divert/${FILE}.orig"
"/usr/sbin/${FILE}"
else
diff --minimal -Nru bfh-metapackages-20211009/debian/changelog
bfh-metapackages-20211009/debian/changelog
--- bfh-metapackages-20211009/debian/changelog 2024-12-12 18:07:25.000000000
+0100
+++ bfh-metapackages-20211009/debian/changelog 2025-01-13 12:35:28.000000000
+0100
@@ -1,3 +1,10 @@
+bfh-metapackages (20211009-31.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix --rename flags on duplicated diversions (DEP17 M18, Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de> Mon, 13 Jan 2025 12:35:28 +0100
+
bfh-metapackages (20211009-31) sid; urgency=medium
* Uploading to sid.
test-bfh.sh
Description: Bourne shell script
--- End Message ---
--- Begin Message ---
Source: bfh-metapackages
Source-Version: 20211009-32
Done: Daniel Baumann <daniel.baum...@progress-linux.org>
We believe that the bug you reported is fixed in the latest version of
bfh-metapackages, 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 1092...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Daniel Baumann <daniel.baum...@progress-linux.org> (supplier of updated
bfh-metapackages 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 ftpmas...@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Thu, 16 Jan 2025 06:47:00 +0100
Source: bfh-metapackages
Architecture: source
Version: 20211009-32
Distribution: sid
Urgency: medium
Maintainer: Daniel Baumann <daniel.baum...@progress-linux.org>
Changed-By: Daniel Baumann <daniel.baum...@progress-linux.org>
Closes: 1092955
Changes:
bfh-metapackages (20211009-32) sid; urgency=medium
.
* Uploading to sid.
* Applying patch from Helmut Grohne <hel...@subdivi.de> to fix --rename
flags on duplicated diversions (DEP17 M18, Closes: #1092955).
Checksums-Sha1:
7e71d6f81078edee0afad7869136b3d5e00bbf2a 1816 bfh-metapackages_20211009-32.dsc
e072d3bc6220fec155de3044804c50b05cb9be47 6520
bfh-metapackages_20211009-32.debian.tar.xz
14d9851ff3f18faf92f041734cd76f6efe86d53d 7378
bfh-metapackages_20211009-32_amd64.buildinfo
Checksums-Sha256:
6ef61a1e1f999c320801f8cca9779d59934f215c735322ce3179af985015b71b 1816
bfh-metapackages_20211009-32.dsc
e842054a692af29632737e9b5a17636a54ee6d1d66cb6cdddd0a2abe00a2d2aa 6520
bfh-metapackages_20211009-32.debian.tar.xz
e8504154562a28585f5663f17e894c06bcc6791b224913befffcf2f8d9cc2a2f 7378
bfh-metapackages_20211009-32_amd64.buildinfo
Files:
cd1b2c9282c4080018d4244da48c558c 1816 metapackages optional
bfh-metapackages_20211009-32.dsc
a71a00a93df786acb637871ff290cb52 6520 metapackages optional
bfh-metapackages_20211009-32.debian.tar.xz
ec2a9eb116ed1b1eaa643d7f66e4999f 7378 metapackages optional
bfh-metapackages_20211009-32_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iHQEARYIAB0WIQQmmGg4gLaoSj0ERgL7tPDoCoAiLwUCZ4iddQAKCRD7tPDoCoAi
L69RAPiVGhz2sqGhzajJLWQupN7q02v0fmIcMc9XI1PtcdrgAP9Zqns+2O4O29HB
n1yckRIBDBuTLwfE68BGXT+Ix/tHDw==
=vRBi
-----END PGP SIGNATURE-----
pgpigP5xci7jV.pgp
Description: PGP signature
--- End Message ---