[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1064298: libhamlib4t64: ineffective replaces due to /usr-move



Package: libhamlib4t64
Version: 4.5.5-3.1~exp1
Severity: serious
Tags: patch
User: helmutg@debian.org
Usertags: dep17p1
Control: affects -1 + libhamlib4
X-Debbugs-Cc: vorlon@debian.org, mwhudson@debian.org

libhamlib4t64 introduced Replaces for libhamlib4 to take over its files
and in that process it also takes over
/usr/lib/udev/rules.d/60-libhamlib4.rules. This file also is in
libhamlib4 in an aliased location. Moving a file from / to /usr and
between packages causes file loss (DEP17 P1). Hence, I'm extending the
existing mitigation for DEP17 P7 (M-A:same shared file loss) to cover
the new P1 problem introduced by time64. See my attched patch. The
protective diversion will be kept beyond postinst and stay around. Since
the earlier diversion in libhamlib4 was removed in postinst, there
cannot be any conflict on diversions. I tested the upgrade using
piuparts.

Helmut
diff --minimal -Nru hamlib-4.5.5/debian/changelog hamlib-4.5.5/debian/changelog
--- hamlib-4.5.5/debian/changelog	2024-02-17 04:43:05.000000000 +0100
+++ hamlib-4.5.5/debian/changelog	2024-02-19 19:50:40.000000000 +0100
@@ -1,3 +1,11 @@
+hamlib (4.5.5-3.1~exp1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Extend DEP17 P7 mitigation (protective diversion for udev rules) to also
+    cover P1 (package rename). (Closes: #-1)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Mon, 19 Feb 2024 19:50:40 +0100
+
 hamlib (4.5.5-3.1~exp1) experimental; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru hamlib-4.5.5/debian/libhamlib4t64.lintian-overrides hamlib-4.5.5/debian/libhamlib4t64.lintian-overrides
--- hamlib-4.5.5/debian/libhamlib4t64.lintian-overrides	2024-02-17 04:43:05.000000000 +0100
+++ hamlib-4.5.5/debian/libhamlib4t64.lintian-overrides	2024-02-19 19:50:40.000000000 +0100
@@ -1,4 +1,4 @@
 # protective diversion for upgrades of files moved from / to /usr
 # see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056692
-libhamlib4t64: diversion-for-unknown-file lib/udev/rules.d/60-libhamlib4t64.rules [preinst:14]
+libhamlib4t64: diversion-for-unknown-file lib/udev/rules.d/60-libhamlib4.rules [preinst:*]
 libhamlib4t64: package-name-doesnt-match-sonames libhamlib4
diff --minimal -Nru hamlib-4.5.5/debian/libhamlib4t64.postinst hamlib-4.5.5/debian/libhamlib4t64.postinst
--- hamlib-4.5.5/debian/libhamlib4t64.postinst	2024-02-17 04:43:05.000000000 +0100
+++ hamlib-4.5.5/debian/libhamlib4t64.postinst	2024-02-19 13:56:14.000000000 +0100
@@ -7,17 +7,6 @@
 
 rm -f /etc/udev/rules.d/60-libhamlib4.rules
 
-# 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/60-libhamlib4.rules.usr-is-merged \
-        --remove /lib/udev/rules.d/60-libhamlib4.rules
-fi
-# end-remove-after
-
 #DEBHELPER#
 
 exit 0
diff --minimal -Nru hamlib-4.5.5/debian/libhamlib4t64.postrm hamlib-4.5.5/debian/libhamlib4t64.postrm
--- hamlib-4.5.5/debian/libhamlib4t64.postrm	2024-02-17 04:43:05.000000000 +0100
+++ hamlib-4.5.5/debian/libhamlib4t64.postrm	2024-02-19 13:56:50.000000000 +0100
@@ -5,16 +5,13 @@
 
 dpkg-maintscript-helper rm_conffile /etc/udev/60-libhamlib4.rules -- "$@"
 
-# 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/60-libhamlib4.rules.usr-is-merged \
         --remove /lib/udev/rules.d/60-libhamlib4.rules
 fi
-# end-remove-after
 
 #DEBHELPER#
 
diff --minimal -Nru hamlib-4.5.5/debian/libhamlib4t64.preinst hamlib-4.5.5/debian/libhamlib4t64.preinst
--- hamlib-4.5.5/debian/libhamlib4t64.preinst	2024-02-17 04:43:05.000000000 +0100
+++ hamlib-4.5.5/debian/libhamlib4t64.preinst	2024-02-19 13:55:31.000000000 +0100
@@ -5,15 +5,13 @@
 
 dpkg-maintscript-helper rm_conffile /etc/udev/60-libhamlib4.rules -- "$@"
 
-# begin-remove-after: released:forky
 # protective diversion of files moved from / to /usr, to avoid file loss.
-# Only for upgrades.
-if [ "$1" = "upgrade" ]; then
+if [ "$1" = upgrade ] || [ "$1" = install ]; then
+    # The diversion should be removed after trixie is released.
     dpkg-divert --package usr-is-merged --no-rename \
         --divert /lib/udev/rules.d/60-libhamlib4.rules.usr-is-merged \
         --add /lib/udev/rules.d/60-libhamlib4.rules
 fi
-# end-remove-after
 
 #DEBHELPER#
 

Reply to: