Package: libiio0
Version: 0.25-1
Severity: important
Tags: patch
User: helm...@debian.org
Usertags: dep17p7
X-Debbugs-Cc: helm...@debian.org

Dear Maintainer,

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

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.


Many thanks,
Chris


[1] https://wiki.debian.org/UsrMerge
diff -Nru libiio-0.25/debian/changelog libiio-0.25/debian/changelog
--- libiio-0.25/debian/changelog        2023-08-11 01:28:57.000000000 +0200
+++ libiio-0.25/debian/changelog        2023-11-26 16:29:08.000000000 +0100
@@ -1,3 +1,11 @@
+libiio (0.25-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 <z...@debian.org>  Sun, 26 Nov 2023 16:29:08 +0100
+
 libiio (0.25-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru libiio-0.25/debian/libiio0.install libiio-0.25/debian/libiio0.install
--- libiio-0.25/debian/libiio0.install  2022-07-10 18:20:01.000000000 +0200
+++ libiio-0.25/debian/libiio0.install  2023-11-26 16:29:08.000000000 +0100
@@ -1,2 +1,2 @@
 usr/lib/*/libiio.so.0*
-lib/udev/rules.d/90-libiio0.rules
+usr/lib/udev/rules.d/90-libiio0.rules
diff -Nru libiio-0.25/debian/libiio0.lintian-overrides 
libiio-0.25/debian/libiio0.lintian-overrides
--- libiio-0.25/debian/libiio0.lintian-overrides        1970-01-01 
01:00:00.000000000 +0100
+++ libiio-0.25/debian/libiio0.lintian-overrides        2023-11-26 
16:29:08.000000000 +0100
@@ -0,0 +1,4 @@
+# begin-remove-after: released:forky
+# protective diversion for upgrades of files moved from / to /usr
+libiio0: diversion-for-unknown-file lib/udev/rules.d/90-libiio0.rules 
[preinst:*]
+# end-remove-after
diff -Nru libiio-0.25/debian/libiio0.postinst 
libiio-0.25/debian/libiio0.postinst
--- libiio-0.25/debian/libiio0.postinst 1970-01-01 01:00:00.000000000 +0100
+++ libiio-0.25/debian/libiio0.postinst 2023-11-26 16:29:08.000000000 +0100
@@ -0,0 +1,16 @@
+#! /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/rules.d/90-libiio0.rules.usr-is-merged \
+        --remove /lib/udev/rules.d/90-libiio0.rules
+fi
+# end-remove-after
+
+#DEBHELPER#
diff -Nru libiio-0.25/debian/libiio0.postrm libiio-0.25/debian/libiio0.postrm
--- libiio-0.25/debian/libiio0.postrm   1970-01-01 01:00:00.000000000 +0100
+++ libiio-0.25/debian/libiio0.postrm   2023-11-26 16:29:08.000000000 +0100
@@ -0,0 +1,16 @@
+#!/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/rules.d/90-libiio0.rules.usr-is-merged \
+        --remove /lib/udev/rules.d/90-libiio0.rules
+fi
+# end-remove-after
+
+#DEBHELPER#
+
diff -Nru libiio-0.25/debian/libiio0.preinst libiio-0.25/debian/libiio0.preinst
--- libiio-0.25/debian/libiio0.preinst  1970-01-01 01:00:00.000000000 +0100
+++ libiio-0.25/debian/libiio0.preinst  2023-11-26 16:29:08.000000000 +0100
@@ -0,0 +1,15 @@
+#!/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/rules.d/90-libiio0.rules.usr-is-merged \
+        --add /lib/udev/rules.d/90-libiio0.rules
+fi
+# end-remove-after
+
+#DEBHELPER#
+
diff -Nru libiio-0.25/debian/rules libiio-0.25/debian/rules
--- libiio-0.25/debian/rules    2023-08-10 21:39:04.000000000 +0200
+++ libiio-0.25/debian/rules    2023-11-26 16:29:08.000000000 +0100
@@ -6,7 +6,8 @@
 
 override_dh_auto_configure:
        dh_auto_configure -- -DCMAKE_SKIP_INSTALL_RPATH=On -DWITH_SYSTEMD=On 
-DWITH_SYSVINIT=On \
-               -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_MAN=ON
+               -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_MAN=ON \
+               -DUDEV_RULES_INSTALL_DIR=/usr/lib/udev/rules.d
 
 override_dh_compress:
        dh_compress -X.c -X.C

Reply via email to