Your message dated Wed, 06 Dec 2023 18:20:06 +0000
with message-id <[email protected]>
and subject line Bug#1056931: fixed in libgphoto2 2.5.31-2
has caused the Debian Bug report #1056931,
regarding libgphoto2-6: Move files into /usr (incl. DEP17 P7 mitigation)
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.)


-- 
1056931: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056931
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libgphoto2-6
Version: 2.5.31-1
Severity: important
Tags: patch
User: [email protected]
Usertags: dep17p7
X-Debbugs-Cc: [email protected]

Dear Maintainer,

libgphoto2-6 contains udev files which are installed to /lib; these
files need to be moved to /usr/lib as part of Debian's usr-merge effort.
Because your package is Multi-Arch: same, an unfortunate corner-case
can occur whereby shared files (such as the udev files) may be
erroneously removed on upgrades (please see DEP17[1] P7: Shared
multiarch file loss).

You will find a patch attached to move the udev files, including the
mitigation for the file loss scenario. Alternatively, you can also use the
salsa merge request I've opened[2].

Please consider applying this patch at your earliest convenience. This
bug will be upgraded to release critical soon, as it blocks the overall
usr-merge effort which is being undertaken for the trixie release.

Note on the patch, esp. the debian/rules part: this tries to be
compatible with dh_installudev changing its default install path, and
then not break on binNMUs. It's ugly, I know.


Many thanks,
Chris

1. https://subdivi.de/~helmut/dep17.html
2. https://salsa.debian.org/debian-phototools-team/libgphoto2/-/merge_requests/6
>From 314bf4fae75d2823fc4445a84b53aefdd4290dc1 Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <[email protected]>
Date: Sun, 26 Nov 2023 21:32:25 +0100
Subject: [PATCH] Move udev files from /lib to /usr/lib

Including protective diversion against Multi-Arch: same file loss scenario
(DEP17 P7 M10).
---
 debian/changelog                      |  8 ++++++++
 debian/libgphoto2-6.lintian-overrides |  6 ++++++
 debian/libgphoto2-6.postinst          | 19 +++++++++++++++++++
 debian/libgphoto2-6.postrm            | 19 +++++++++++++++++++
 debian/libgphoto2-6.preinst           | 18 ++++++++++++++++++
 debian/rules                          |  8 ++++++--
 6 files changed, 76 insertions(+), 2 deletions(-)
 create mode 100644 debian/libgphoto2-6.postinst
 create mode 100644 debian/libgphoto2-6.postrm
 create mode 100644 debian/libgphoto2-6.preinst

diff --git a/debian/changelog b/debian/changelog
index b835d5f57..d666f2a66 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+libgphoto2 (2.5.31-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Move udev files from /lib to /usr/lib, including protective diversion
+    against Multi-Arch: same file loss scenario (DEP17 P7 M10). (Closes: #-1)
+
+ -- Chris Hofstaedtler <[email protected]>  Sun, 26 Nov 2023 21:27:28 +0100
+
 libgphoto2 (2.5.31-1) unstable; urgency=medium
 
   * [33c8d67] The kFreeBSD port has been removed
diff --git a/debian/libgphoto2-6.lintian-overrides 
b/debian/libgphoto2-6.lintian-overrides
index dd6d57455..e1ae1f513 100644
--- a/debian/libgphoto2-6.lintian-overrides
+++ b/debian/libgphoto2-6.lintian-overrides
@@ -5,3 +5,9 @@ libgphoto2-6: spelling-error-in-binary Optio Option 
[usr/lib/*/libgphoto2/*/sier
 # strcpy(id->text, "Lumix Wifi") using immediate values.  The letter
 # "H" is part of the next machine instruction, "ifi\0" follows shortly.
 libgphoto2-6: spelling-error-in-binary WiH With 
[usr/lib/*/libgphoto2/*/lumix.so]
+
+# begin-remove-after: released:forky
+# protective diversion for upgrades of files moved from / to /usr
+libgphoto2-6: diversion-for-unknown-file lib/udev/hwdb.d/20-libgphoto2-6.hwdb 
[preinst:*]
+libgphoto2-6: diversion-for-unknown-file 
lib/udev/rules.d/60-libgphoto2-6.rules [preinst:*]
+# end-remove-after
diff --git a/debian/libgphoto2-6.postinst b/debian/libgphoto2-6.postinst
new file mode 100644
index 000000000..d8269e6cb
--- /dev/null
+++ b/debian/libgphoto2-6.postinst
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+set -e
+
+# begin-remove-after: released:forky
+# protective diversion of files moved from / to /usr, to avoid file loss.
+# Only for upgrades.
+if [ "$1" = "configure" ]; then
+    # At this point, the package will have installed the same file in */usr*.
+    dpkg-divert --package usr-is-merged --no-rename \
+        --divert /lib/udev/hwdb.d/20-libgphoto2-6.hwdb.usr-is-merged \
+        --remove /lib/udev/hwdb.d/20-libgphoto2-6.hwdb
+    dpkg-divert --package usr-is-merged --no-rename \
+        --divert /lib/udev/rules.d/60-libgphoto2-6.rules.usr-is-merged \
+        --remove /lib/udev/rules.d/60-libgphoto2-6.rules
+fi
+# end-remove-after
+
+#DEBHELPER#
diff --git a/debian/libgphoto2-6.postrm b/debian/libgphoto2-6.postrm
new file mode 100644
index 000000000..7584525c3
--- /dev/null
+++ b/debian/libgphoto2-6.postrm
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+
+# begin-remove-after: released:forky
+# protective diversion of files moved from / to /usr, to avoid file loss.
+# Only for upgrades.
+if [ "$1" = "remove" ] && [ "$DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT" = "1" ]; then
+    # Cleanup in case package is removed before upgrade is finished (postinst 
ran).
+    dpkg-divert --package usr-is-merged --no-rename \
+        --divert /lib/udev/hwdb.d/20-libgphoto2-6.hwdb.usr-is-merged \
+        --remove /lib/udev/hwdb.d/20-libgphoto2-6.hwdb
+    dpkg-divert --package usr-is-merged --no-rename \
+        --divert /lib/udev/rules.d/60-libgphoto2-6.rules.usr-is-merged \
+        --remove /lib/udev/rules.d/60-libgphoto2-6.rules
+fi
+# end-remove-after
+
+#DEBHELPER#
+
diff --git a/debian/libgphoto2-6.preinst b/debian/libgphoto2-6.preinst
new file mode 100644
index 000000000..544812f6d
--- /dev/null
+++ b/debian/libgphoto2-6.preinst
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+# begin-remove-after: released:forky
+# protective diversion of files moved from / to /usr, to avoid file loss.
+# Only for upgrades.
+if [ "$1" = "upgrade" ]; then
+    dpkg-divert --package usr-is-merged --no-rename \
+        --divert /lib/udev/hwdb.d/20-libgphoto2-6.hwdb.usr-is-merged \
+        --add /lib/udev/hwdb.d/20-libgphoto2-6.hwdb
+    dpkg-divert --package usr-is-merged --no-rename \
+        --divert /lib/udev/rules.d/60-libgphoto2-6.rules.usr-is-merged \
+        --add /lib/udev/rules.d/60-libgphoto2-6.rules
+fi
+# end-remove-after
+
+#DEBHELPER#
+
diff --git a/debian/rules b/debian/rules
index 6c87bd531..28028ff55 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,10 +37,14 @@ override_dh_installudev:
        # rm debian/libgphoto2-2/lib/udev/check-ptp-camera
        # Generate the udev file, get it installed, and clean:
        CAMLIBS=`ls -d 
debian/libgphoto2-$(major)/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2/2*` 
./packaging/generic/print-camera-list udev-rules version 201 mode 0664 group 
plugdev > debian/libgphoto2-$(major).udev
-       mkdir -p debian/libgphoto2-$(major)/lib/udev/hwdb.d/
-       CAMLIBS=`ls -d 
debian/libgphoto2-$(major)/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2/2*` 
./packaging/generic/print-camera-list hwdb > 
debian/libgphoto2-$(major)/lib/udev/hwdb.d/20-libgphoto2-$(major).hwdb
+       mkdir -p debian/libgphoto2-$(major)/usr/lib/udev/hwdb.d/
+       CAMLIBS=`ls -d 
debian/libgphoto2-$(major)/usr/lib/$(DEB_HOST_MULTIARCH)/libgphoto2/2*` 
./packaging/generic/print-camera-list hwdb > 
debian/libgphoto2-$(major)/usr/lib/udev/hwdb.d/20-libgphoto2-$(major).hwdb
        dh_installudev
        rm debian/libgphoto2-$(major).udev
+       # This will become harmless after dh_installudev changes the default 
install path.
+       set -e; if test -d debian/libgphoto2-6/lib/udev/rules.d; then mv 
debian/libgphoto2-6/lib/udev/rules.d debian/libgphoto2-6/usr/lib/udev; fi
+       set -e; if test -d debian/libgphoto2-6/lib/udev; then rmdir 
debian/libgphoto2-6/lib/udev; fi
+       set -e; if test -d debian/libgphoto2-6/lib; then rmdir 
debian/libgphoto2-6/lib; fi
 endif
 
 override_dh_fixperms:
-- 
2.39.2


--- End Message ---
--- Begin Message ---
Source: libgphoto2
Source-Version: 2.5.31-2
Done: Andreas Metzler <[email protected]>

We believe that the bug you reported is fixed in the latest version of
libgphoto2, 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.
Andreas Metzler <[email protected]> (supplier of updated libgphoto2 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: Wed, 06 Dec 2023 18:46:28 +0100
Source: libgphoto2
Architecture: source
Version: 2.5.31-2
Distribution: unstable
Urgency: medium
Maintainer: Debian PhotoTools Maintainers 
<[email protected]>
Changed-By: Andreas Metzler <[email protected]>
Closes: 1056931
Changes:
 libgphoto2 (2.5.31-2) unstable; urgency=medium
 .
   [ Andreas Metzler ]
   * Team upload.
 .
   [ Chris Hofstaedtler ]
   * [9feb63a] Move udev files from /lib to /usr/lib.
     Including protective diversion against Multi-Arch: same file loss scenario
     (DEP17 P7 M10). Closes: #1056931
Checksums-Sha1: 
 586a06cfefaacc8453e3673ff7d978c5291b0e77 2792 libgphoto2_2.5.31-2.dsc
 bb594e94074f8d5250ab72e458ea3fc772b89c64 100232 
libgphoto2_2.5.31-2.debian.tar.xz
Checksums-Sha256: 
 3424e77a0b9000ba945247b1e13b3e51320806e0c189b4cbd448422994e40d66 2792 
libgphoto2_2.5.31-2.dsc
 8d3775e5e04b4e974d629b760d731bb1ea1f5e6baf05405a663136d811f36b06 100232 
libgphoto2_2.5.31-2.debian.tar.xz
Files: 
 74f68ba41e181970380114c2365c358d 2792 libs optional libgphoto2_2.5.31-2.dsc
 79e4fc4ff6c0fb733b4839eb493758d0 100232 libs optional 
libgphoto2_2.5.31-2.debian.tar.xz

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

iQIzBAEBCgAdFiEE0uCSA5741Jbt9PpepU8BhUOCFIQFAmVwtFAACgkQpU8BhUOC
FIRr5g/8DTMMIM2kq1OKSNY1dIdH46Jufx9UTPWkzyIZTzGdaQLbg4Ehi4f54XOQ
C2riqy/mC9di7TmhixtqM692LKcSM38kcutoryrzqYs12L/HCRP9c+Fv4ZO5aNhj
n5PPCwXjbAgdGmrsBeDTnLcse2u/EDNXBBCqf1ueo7SrnjaInz25fmRizPoy+WGc
Mk7rejVCSSSETuBPwPexdiflhBpLJ2pfc0G9zQZeEwFBHJZSvUSJ5/UlD7R0vnaD
uNo/c9ShbmV2hclrNp7yPjr/sc8NmrFkIqHPD4eG9hh6Euml20qvq2BRE0SzhrU5
AGB3dmcUmrQn02XuUnqAXEv7Qnl++7WtozC5TkvFaQ6sEND063an6mxdiaRVnBJQ
s0Ly4TSseR6Tqlb2OuqaMSywxNdAhcPsfP3KvbU8+CzLLhzAqiyUNijD/zXKXbKb
lwfNRVtHmbzXBnX+dcyQ+KcSrxwINozF+OnSghk8BloT+kk/pqqlztDmfg7ZrX0M
8SmVCOvfU1vLHVXWGugDgkR8rFDDqV00LSy9C52pwPTK1vpb+tu0otEZIy/VcgQb
a5LTVgF3JpvZUgml27ecM1NMH1gCaiwcw42bAjdjbNu2KKC/YQYwUKE9dWoYR9XN
reQ8fR5BEdL0Wro2lDtItyQg6iNJpwpzo0QRTl2dKtKh6rzWTKg=
=fF6Q
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to