Article 5J522 "installpkg --root " and "ldconfig -r"

"installpkg --root " and "ldconfig -r"

by
tfonz
from LinuxQuestions.org on (#5J522)
installpkg contains this comment:

Code: # It's a good idea to make sure those newly installed libraries are properly
# activated for use, unless ROOT is pointing somewhere else in which case
# running ldconfig on the host system won't make any difference:followed by:

Code: if [ "$ROOT" = "" ] && [ -x /sbin/ldconfig ]; then
( flock 9 || exit 11
/sbin/ldconfig 2> /dev/null
) 9> $INSTLOCKDIR/ldconfig.lock
fiI don't know since when, but ldconfig supports -r. From the man-page:

Code: -r root
Change to and use root as the root directory.So it seems, installpkg --root could use ldconfig -r, like this (replacing the above if):

Code: if [ -x /sbin/ldconfig ]; then
( flock 9 || exit 11
/sbin/ldconfig -r "$ROOT/" 2> /dev/null
) 9> $INSTLOCKDIR/ldconfig.lock
fiNote that this is intentionally using "/sbin/ldconfig" and not "$ROOT/sbin/ldconfig". So it'll work already for the initial packages, no matter in which order you install them, or if you skip glibc-solibs. And installpkg relies on host tools (tar, etc) anyway.latest?d=yIl2AUoC8zA latest?i=vepI3XtK7ys:PwG8RiiCGCQ:F7zBnMy latest?i=vepI3XtK7ys:PwG8RiiCGCQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=vepI3XtK7ys:PwG8RiiCGCQ:gIN9vFwvepI3XtK7ys
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments