Hi,
On Wed, 17 Aug 2022 18:20:36 +0200 Johannes Schauer Marin Rodrigues
wrote:
> On Wed, 16 Mar 2022 13:30:26 +0100 Johannes Schauer Marin Rodrigues
> wrote:
> > when creating chroots for new architectures that are in the process of being
> > bootstrapped without yet having emulation support from qemu, it is not
> > possible to run maintainer scripts inside the foreign architecture chroot
> > because foreign architecture ELF binaries cannot be executed. The solution
> > to
> > that problem is to run maintainer scripts from outside the chroot and use
> > the
> > DPKG_ROOT environment variable to instruct the maintainer script on which
> > chroot to operate. By default, for normal installations, that environment
> > variable is set, but empty.
> >
> > Apart from init-system-helpers and pam, all packages in the
> > Essential:yes set have support for DPKG_ROOT already. To start building
> > packages we also need to install build-essential.
> >
> > Please consider applying the patch from this merge request:
> >
> > https://salsa.debian.org/toolchain-team/gcc-defaults/-/merge_requests/4
> >
> > We tested it in our CI environment and it produces a bit-by-bit
> > identical chroot with DPKG_ROOT compared to a normal installation.
> >
> > https://salsa.debian.org/helmutg/dpkg-root-demo/
> >
> > Since the DPKG_ROOT variable is empty on normal installations, the patch
> > should have no effect in the normal case.
>
> I wanted to send a friendly ping about this bug. I see that since I filed this
> bug, you uploaded three new versions of gcc-defaults. Please consider applying
> the changes of above merge request against gcc-defaults on salsa. Here is the
> diff in plain text for your convenience:
>
> --- a/debian/g++.postinst.in
> +++ b/debian/g++.postinst.in
> @@ -2,9 +2,9 @@
>
> # remove the doc dir, if it's still a directory and replace with a symlink
> pkg=`basename $0 .postinst`
> -if [ ! -L /usr/share/doc/$pkg ]; then
> -rm -rf /usr/share/doc/$pkg
> -ln -s cpp /usr/share/doc/$pkg
> +if [ ! -L "$DPKG_ROOT/usr/share/doc/$pkg" ]; then
> +rm -rf "$DPKG_ROOT/usr/share/doc/$pkg"
> +ln -s cpp "$DPKG_ROOT/usr/share/doc/$pkg"
> fi
>
> # fix for report #138038: remove old diversions
I uploaded an NMU of gcc-defaults with the maximum delay of 15 days. Please
cancel if you disagree. Full debdiff attached.
Thanks!
cheers, joschdiff -Nru gcc-defaults-1.200/debian/changelog gcc-defaults-1.200+nmu1/debian/changelog
--- gcc-defaults-1.200/debian/changelog 2022-07-22 17:31:39.0 +0200
+++ gcc-defaults-1.200+nmu1/debian/changelog 2022-08-28 08:23:21.0 +0200
@@ -1,3 +1,10 @@
+gcc-defaults (1.200+nmu1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Support DPKG_ROOT in g++ postinst (closes: #1007764)
+
+ -- Johannes Schauer Marin Rodrigues Sun, 28 Aug 2022 08:23:21 +0200
+
gcc-defaults (1.200) unstable; urgency=medium
* Stop building gccbrig, removed in GCC 12.
diff -Nru gcc-defaults-1.200/debian/g++.postinst.in gcc-defaults-1.200+nmu1/debian/g++.postinst.in
--- gcc-defaults-1.200/debian/g++.postinst.in 2020-11-17 19:53:07.0 +0100
+++ gcc-defaults-1.200+nmu1/debian/g++.postinst.in 2022-08-28 08:23:21.0 +0200
@@ -2,9 +2,9 @@
# remove the doc dir, if it's still a directory and replace with a symlink
pkg=`basename $0 .postinst`
-if [ ! -L /usr/share/doc/$pkg ]; then
-rm -rf /usr/share/doc/$pkg
-ln -s cpp /usr/share/doc/$pkg
+if [ ! -L "$DPKG_ROOT/usr/share/doc/$pkg" ]; then
+rm -rf "$DPKG_ROOT/usr/share/doc/$pkg"
+ln -s cpp "$DPKG_ROOT/usr/share/doc/$pkg"
fi
# fix for report #138038: remove old diversions
signature.asc
Description: signature