Your message dated Wed, 03 Nov 2021 10:43:11 +0100
with message-id <163593259192.1741.12169455669738924511@localhost>
and subject line Re: Bug#994963: dash: please support DPKG_ROOT
has caused the Debian Bug report #994963,
regarding dash: please support DPKG_ROOT
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
994963: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994963
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: dash
Severity: normal
Tags: patch
User: [email protected]
Usertags: dpkg-root-support
Hi,
Hi,
since dpkg 1.18.5, dpkg sets the variable DPKG_ROOT when invoking
maintainer scripts. Usually that variable is empty but when calling dpkg
with --root and --force-script-chrootless, dpkg will set DPKG_ROOT to
the new root directory. In that mode, maintainer scripts are called
without chroot(1) around them, and thus have to be able to possibly
operate on the path from DPKG_ROOT instead of working on /. This is
useful for bootstrapping, creating chroots for foreign architectures
where utilities from inside the chroot cannot be executed, avoiding
dependency loops between postinst scripts, installation without
requiring superuser privileges and for creating installations that do
not even contain dpkg. See
https://wiki.debian.org/Teams/Dpkg/Spec/InstallBootstrap for more
information.
We have set up a weekly salsa job that patches 10 source packages plus
dash and then shows how a chroot created with DPKG_ROOT is bit-by-bit
identical to a chroot created the normal way:
https://salsa.debian.org/helmutg/dpkg-root-demo/-/pipelines
The changes needed for dash are twofold:
1. prefixing paths in dash.postinst with DPKG_ROOT (this bug)
2. replacing add-shell with triggers once debianutils >= 5.1-1 migrates
to testing
Since debianutils is currently blocked from migration, this bug is about
the first item.
Please consider applying the attached patch.
Thanks!
cheers, josch
diff -Nru dash-0.5.11+git20200708+dd9ef66/debian/dash.postinst
dash-0.5.11+git20200708+dd9ef66/debian/dash.postinst
--- dash-0.5.11+git20200708+dd9ef66/debian/dash.postinst 2020-12-10
14:23:19.000000000 +0100
+++ dash-0.5.11+git20200708+dd9ef66/debian/dash.postinst 2021-06-17
19:31:47.000000000 +0200
@@ -3,8 +3,8 @@
# $1: dfile, $2: link target, $3: distrib
replace_with_link() {
- dfile=$1; ltarget=$2; distrib=$3
- temp=$dfile.tmp
+ dfile="$DPKG_ROOT$1"; ltarget=$2; distrib="$DPKG_ROOT$3"
+ temp="$dfile.tmp"
# Safely create a symlink to $ltarget at $dfile, first
# making a backup of $dfile (the file being diverted)
# in $distrib (if specified).
@@ -47,8 +47,8 @@
dpkg-divert --package bash --no-rename --remove $dfile
dpkg-divert --package dash --no-rename --divert $distrib --add $dfile
# remove the old equivalent of $distrib, if it existed.
- if [ -n "$truename" ]; then
- rm -f "$truename"
+ if [ -n "$DPKG_ROOT$truename" ]; then
+ rm -f "$DPKG_ROOT$truename"
fi
replace_with_link $dfile $ltarget $distrib
}
@@ -132,7 +135,7 @@
db_get dash/sh
if [ "$RET" = true ]; then
claim_binsh /bin/sh dash
- if [ -d /usr/share/man/man1/ ]; then
+ if [ -d "$DPKG_ROOT/usr/share/man/man1/" ]; then
claim_binsh /usr/share/man/man1/sh.1.gz dash.1.gz \
/usr/share/man/man1/sh.distrib.1.gz
fi
--- End Message ---
--- Begin Message ---
Control: fixed -1 0.5.11+git20210120+802ebd4-2
Hi,
Quoting Andrej Shadura (2021-10-23 11:44:38)
> You’re right. I’ll upload dash with your patch right now.
I think you forgot to close this bug in your upload. Closing now.
Thanks!
cheers, josch
P.S.: Your last upload of dash will break quite a few source packages, see bugs
#998361 or #998377 -- we probably need an archive rebuild to spot all the
instances...
signature.asc
Description: signature
--- End Message ---