From 932a3716bc81e2ce2b01ced927645b2196fb1501 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Thu, 23 Sep 2021 06:07:48 +0200 Subject: [PATCH] ldconfig.fakechroot: support DPKG_ROOT --- ldconfig.fakechroot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ldconfig.fakechroot b/ldconfig.fakechroot index 509263b..7a5e3bd 100755 --- a/ldconfig.fakechroot +++ b/ldconfig.fakechroot @@ -90,6 +90,12 @@ def main(): chroot = Path(os.environ["FAKECHROOT_BASE_ORIG"]) + # if chrootless mode is used from within a fakechroot chroot, then + # FAKECHROOT_BASE_ORIG will point at the outer chroot. We want to use + # the path from DPKG_ROOT inside of that instead + if os.environ.get("DPKG_ROOT", "") not in ["", "/"]: + chroot /= os.environ["DPKG_ROOT"].lstrip("/") + if not (chroot / "sbin" / "ldconfig").exists(): sys.exit(0)