ldconfig.fakechroot: do not ignore it, if ldconfig was already called with -r
This commit is contained in:
parent
9cc494f245
commit
4974f59248
1 changed files with 15 additions and 1 deletions
|
@ -106,10 +106,24 @@ def main():
|
||||||
for d in get_libdirs(chroot, [chroot / "etc" / "ld.so.conf"]):
|
for d in get_libdirs(chroot, [chroot / "etc" / "ld.so.conf"]):
|
||||||
make_relative(d)
|
make_relative(d)
|
||||||
|
|
||||||
|
rootarg = chroot
|
||||||
|
argv = sys.argv[1:]
|
||||||
|
for arg in sys.argv[1:]:
|
||||||
|
if arg == "-r":
|
||||||
|
rootarg = None
|
||||||
|
elif rootarg is None:
|
||||||
|
argpath = Path(arg)
|
||||||
|
if argpath.is_absolute():
|
||||||
|
rootarg = chroot / argpath.relative_to("/")
|
||||||
|
else:
|
||||||
|
rootarg = Path.cwd() / argpath
|
||||||
|
if rootarg is None:
|
||||||
|
rootarg = chroot
|
||||||
|
|
||||||
# we add any additional arguments before "-r" such that any other "-r"
|
# we add any additional arguments before "-r" such that any other "-r"
|
||||||
# option will be overwritten by the one we set
|
# option will be overwritten by the one we set
|
||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
[chroot / "sbin" / "ldconfig"] + sys.argv[1:] + ["-r", chroot]
|
[chroot / "sbin" / "ldconfig"] + sys.argv[1:] + ["-r", rootarg]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue