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

Bug#1063451: foo2zjs: move all files to /usr DEP17 + empty directory loss



Source: foo2zjs
Version: 20200505dfsg0-2
Tags: patch
User: helmutg@debian.org
Usertags: dep17m2 dep17p6

Hi,

we are in the process of finalizing the /usr-merge by moving all aliased
files from / to /usr via DEP17. printer-driver-foo2zjs contains an empty
directory /lib/firmware/hp in an aliased location. If this is moved to
/usr, it will be lost in a package upgrade. This loss is flagged by
dumat and is the reason I'm writing this mail. Since no other package in
Debian writes any files to /lib/firmware/hp or /usr/lib/firmware/hp,
this loss can only happen during the package upgrade. Therefore,
recreating the lost directory in printer-driver-foo2zjs.postinst is a
reasonable mitigation. I've implemented the /usr-move and this
mitigation in the attached patch. After applying it, the /usr-move is
done from a foo2zjs perspective. Note that this patch must not be
backported to bookworm-backports. I hope this is not a problem as
foo2zjs has not been backported in earlier releases. In case it needs to
be backports, this patch needs to be reverted. If this leaves any
questions, don't hesitate to ask.

Helmut

DEP17: http://subdivi.de/~helmut/dep17.html
diff --minimal -Nru foo2zjs-20200505dfsg0/debian/NEWS foo2zjs-20200505dfsg0/debian/NEWS
--- foo2zjs-20200505dfsg0/debian/NEWS	2021-09-02 14:45:45.000000000 +0200
+++ foo2zjs-20200505dfsg0/debian/NEWS	2024-02-08 13:55:52.000000000 +0100
@@ -1,7 +1,7 @@
 foo2zjs (20090908dfsg-2) unstable; urgency=low
 
   Starting with this version all HP firmwares are looked for into
-  /lib/firmware/hp/ instead of upstream /usr/share/foo2zjs/firmware/
+  /usr/lib/firmware/hp/ instead of upstream /usr/share/foo2zjs/firmware/
   (thus solving bug #517957).
 
   The upstream /usr/bin/getweb and /lib/udev/hplj1000 scripts have
diff --minimal -Nru foo2zjs-20200505dfsg0/debian/changelog foo2zjs-20200505dfsg0/debian/changelog
--- foo2zjs-20200505dfsg0/debian/changelog	2021-09-02 14:45:45.000000000 +0200
+++ foo2zjs-20200505dfsg0/debian/changelog	2024-02-08 14:01:50.000000000 +0100
@@ -1,3 +1,10 @@
+foo2zjs (20200505dfsg0-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * DEP17: Move all aliased files to /usr. (Closes: #-1)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Thu, 08 Feb 2024 14:01:50 +0100
+
 foo2zjs (20200505dfsg0-2) unstable; urgency=medium
 
   * Remove myself from Uploaders
diff --minimal -Nru foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs-common.install foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs-common.install
--- foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs-common.install	2021-09-02 14:45:45.000000000 +0200
+++ foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs-common.install	2024-02-08 13:54:31.000000000 +0100
@@ -1,7 +1,7 @@
 PPD/* usr/share/ppd/foo2zjs/
 debian/printer-driver-foo2zjs-common.ppd-updater /usr/share/cups/ppd-updaters/
 getweb usr/sbin
-hplj1000 lib/udev
+hplj1000 usr/lib/udev
 hplj1020.desktop usr/share/applications/
 hplj1020_icon.png usr/share/pixmaps
 usr/bin/foo2ddst-wrapper
diff --minimal -Nru foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.dirs foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.dirs
--- foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.dirs	2021-09-02 14:45:45.000000000 +0200
+++ foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.dirs	2024-02-08 13:58:25.000000000 +0100
@@ -1 +1 @@
-/lib/firmware/hp/
+/usr/lib/firmware/hp/
diff --minimal -Nru foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.links foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.links
--- foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.links	2021-09-02 14:45:45.000000000 +0200
+++ foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.links	2024-02-08 13:55:25.000000000 +0100
@@ -1,10 +1,10 @@
-lib/udev/hplj1000 lib/udev/hplj1005
-lib/udev/hplj1000 lib/udev/hplj1018
-lib/udev/hplj1000 lib/udev/hplj1020
-lib/udev/hplj1000 lib/udev/hpljP1005
-lib/udev/hplj1000 lib/udev/hpljP1006
-lib/udev/hplj1000 lib/udev/hpljP1007
-lib/udev/hplj1000 lib/udev/hpljP1008
-lib/udev/hplj1000 lib/udev/hpljP1505
-lib/udev/hplj1000 lib/udev/hpljP1505n
+usr/lib/udev/hplj1000 usr/lib/udev/hplj1005
+usr/lib/udev/hplj1000 usr/lib/udev/hplj1018
+usr/lib/udev/hplj1000 usr/lib/udev/hplj1020
+usr/lib/udev/hplj1000 usr/lib/udev/hpljP1005
+usr/lib/udev/hplj1000 usr/lib/udev/hpljP1006
+usr/lib/udev/hplj1000 usr/lib/udev/hpljP1007
+usr/lib/udev/hplj1000 usr/lib/udev/hpljP1008
+usr/lib/udev/hplj1000 usr/lib/udev/hpljP1505
+usr/lib/udev/hplj1000 usr/lib/udev/hpljP1505n
 usr/bin/psicc usr/bin/foo2zjs-icc2ps
diff --minimal -Nru foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.lintian-overrides foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.lintian-overrides
--- foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.lintian-overrides	2021-09-02 14:45:45.000000000 +0200
+++ foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.lintian-overrides	2024-02-08 13:58:37.000000000 +0100
@@ -1,5 +1,5 @@
 # That's on purpose, getweb can go fetch these from the web
-package-contains-empty-directory lib/firmware/hp/
+package-contains-empty-directory usr/lib/firmware/hp/
 
 # Manpages are shipped in printer-driver-foo2zjs-common
 no-manual-page usr/bin/arm2hpdl
diff --minimal -Nru foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.postinst foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.postinst
--- foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.postinst	2021-09-02 14:45:45.000000000 +0200
+++ foo2zjs-20200505dfsg0/debian/printer-driver-foo2zjs.postinst	2024-02-08 14:01:50.000000000 +0100
@@ -3,9 +3,13 @@
 set -e
 
 if [ "$1" = configure ]; then
+    # begin-remove-after: released:trixie
+    # Mitigate empty directory loss in upgrade DEP17 P6.
+    mkdir -p /usr/lib/firmware/hp
+    # end-remove-after
     # Move user-downloaded firmware files
     if ls /usr/share/foo2zjs/firmware/*.dl >/dev/null 2>/dev/null; then
-	mv /usr/share/foo2zjs/firmware/*.dl /lib/firmware/hp/ 2>/dev/null
+	mv /usr/share/foo2zjs/firmware/*.dl /usr/lib/firmware/hp/ 2>/dev/null
     fi
 fi
 
diff --minimal -Nru foo2zjs-20200505dfsg0/debian/rules foo2zjs-20200505dfsg0/debian/rules
--- foo2zjs-20200505dfsg0/debian/rules	2021-09-02 14:45:45.000000000 +0200
+++ foo2zjs-20200505dfsg0/debian/rules	2024-02-08 13:59:23.000000000 +0100
@@ -39,7 +39,7 @@
 	install -D -m 644 usb_printerid $(CURDIR)/debian/printer-driver-foo2zjs/usr/bin/usb_printerid
 	install -D -m 644 usb_printerid.1 $(CURDIR)/debian/printer-driver-foo2zjs-common/usr/share/man/man1/usb_printerid.1
 	# Use a policy-numbered name for the Linux-specific udev rules file
-	install -D -m 644 hplj10xx.rules $(CURDIR)/debian/printer-driver-foo2zjs/lib/udev/rules.d/85-hplj10xx.rules
+	install -D -m 644 hplj10xx.rules $(CURDIR)/debian/printer-driver-foo2zjs/usr/lib/udev/rules.d/85-hplj10xx.rules
 endif
 ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
 	# /etc/devd/hplj10xx.conf is kFreeBSD-specific

Reply to: