Package: coreutils
Version: 8.32-4
Tags: patch
User: debian-d...@lists.debian.org
Usertags: dpkg-root-support

We're working on a way to install packages into a chroot without
actually using the chroot system call. A consequence of doing so is that
maintainer scripts are run outside the chroot and are supposed to still
operate on the chroot whose location is communicated via the DPKG_ROOT
environment variable.

coreutils contains two maintainer scripts that manage the /usr/bin/touch
symlink. These need to be adapted to work with the mode depicted above.

Please refer to
https://wiki.debian.org/Teams/Dpkg/Spec/InstallBootstrap for more
details.

Please consider applying the attached patch (post bullseye).

Helmut
diff --minimal -Nru coreutils-8.32/debian/changelog 
coreutils-8.32/debian/changelog
--- coreutils-8.32/debian/changelog     2020-09-22 14:17:17.000000000 +0200
+++ coreutils-8.32/debian/changelog     2021-02-26 10:52:22.000000000 +0100
@@ -1,3 +1,10 @@
+coreutils (8.32-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Support DPKG_ROOT in maintainer scripts. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Fri, 26 Feb 2021 10:52:22 +0100
+
 coreutils (8.32-4) unstable; urgency=low
 
   * Fix FTBFS on ARM64. (Closes: #966449)
diff --minimal -Nru coreutils-8.32/debian/coreutils.postinst 
coreutils-8.32/debian/coreutils.postinst
--- coreutils-8.32/debian/coreutils.postinst    2016-01-15 20:47:18.000000000 
+0100
+++ coreutils-8.32/debian/coreutils.postinst    2021-02-26 10:52:20.000000000 
+0100
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -e
 
-if [ "$1" = 'configure' -a ! -e '/usr/bin/touch' ]; then
-  ln -s /bin/touch /usr/bin/touch
+if [ "$1" = 'configure' -a ! -e "$DPKG_ROOT/usr/bin/touch" ]; then
+  ln -s /bin/touch "$DPKG_ROOT/usr/bin/touch"
 fi
 
 #DEBHELPER#
diff --minimal -Nru coreutils-8.32/debian/coreutils.postrm 
coreutils-8.32/debian/coreutils.postrm
--- coreutils-8.32/debian/coreutils.postrm      2016-01-15 18:11:14.000000000 
+0100
+++ coreutils-8.32/debian/coreutils.postrm      2021-02-26 10:52:20.000000000 
+0100
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -e
 
-if [ "$1" = 'remove' -a -L '/usr/bin/touch' ]; then
-  rm /usr/bin/touch
+if [ "$1" = 'remove' -a -L "$DPKG_ROOT/usr/bin/touch" ]; then
+  rm "$DPKG_ROOT/usr/bin/touch"
 fi
 
 #DEBHELPER#

Reply via email to