Package: ucf
Version: 3.0052
Severity: wishlist
Tags: patch
X-Debbugs-Cc: [email protected]
User: [email protected]
Usertags: hurd-amd64 hurd-i386

Hi,

to create a Debian GNU/Hurd chroot from Debian GNU/Linux, so called
"chrootless" or --force-script-chrootless (the dpkg option) has to be used
because Hurd binaries cannot be run on Linux. Since systemd cannot work on
GNU/Hurd, sysvinit is the default init system there. To use sysvinit
effectively, the package orphan-sysvinit-scripts is a desirable installation
candidate. The package orphan-sysvinit-scripts depends on ucf. Installing ucf
with --force-script-chrootless currently fails because its preinst and
postinst maintainer scripts do not respect the $DPKG_ROOT environment
variable. The patch at the end of this email fixes this. I also opened a
MR on salsa for your convenience:
https://salsa.debian.org/debian/ucf/-/merge_requests/4

The changes have been verified to have the desired results in the salsa CI
pipeline of this merge request for the dpkg-root-demo:
https://salsa.debian.org/helmutg/dpkg-root-demo/-/merge_requests/7

Thanks!

cheers, josch

diff --git a/debian/ucf.postinst b/debian/ucf.postinst
index 3fd1d87..9f4c062 100755
--- a/debian/ucf.postinst
+++ b/debian/ucf.postinst
@@ -4,8 +4,8 @@ set -e
 
 case "$1" in
   configure)
-    touch /var/lib/ucf/hashfile
-    touch /var/lib/ucf/registry
+    touch "$DPKG_ROOT/var/lib/ucf/hashfile"
+    touch "$DPKG_ROOT/var/lib/ucf/registry"
     ;;
   abort-upgrade) ;;
   abort-remove) ;;
diff --git a/debian/ucf.preinst b/debian/ucf.preinst
index 8aa02a6..66b7a41 100755
--- a/debian/ucf.preinst
+++ b/debian/ucf.preinst
@@ -2,7 +2,7 @@
 
 set -e
 
-statedir='/var/lib/ucf';
+statedir="${DPKG_ROOT}/var/lib/ucf";
 
 case "$1" in
   install)

Reply via email to