Skip to content

Commit

Permalink
#142: Automatically create ldconfig conf for obsolete dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratler committed Mar 20, 2020
1 parent e9513bc commit 1eb38e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions etc/config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export DIALOGRC=/etc/lunar/dialogrc
DEFAULT_PREFIX=/usr

OBSOLETE_LIB_DIR=/usr/lib/lunar/OBSOLETE
OBSOLETE_LD_CONF=/etc/ld.so.conf.d/obsolete-libs.conf

BOOTSTRAP=/var/lib/lunar/bootstrap
EXCLUDED=/var/lib/lunar/excluded
Expand Down
5 changes: 5 additions & 0 deletions libs/build.lunar
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ save_obsolete_libraries() {
mkdir -p "$OBSOLETE_LIB_DIR"
fi

if [[ -d "/etc/ld.so.conf.d" && ! -f "$OBSOLETE_LD_CONF" ]]; then
echo "/usr/lib/lunar/OBSOLETE" > $OBSOLETE_LD_CONF
fi

for f in $(ls -1 $OLD_LIBS/*.so* 2> /dev/null); do
LIB=$(basename $f)
if ! parse_iw | grep -q $LIB; then
Expand All @@ -108,6 +112,7 @@ remove_obsolete_libraries() {
debug_msg "remove_obsolete_libraries($@)"
verbose_msg "Removing OBSOLETE libraries"
rm -rf "$OBSOLETE_LIB_DIR"
rm -f "$OBSOLETE_LD_CONF"
ldconfig
}

Expand Down

0 comments on commit 1eb38e4

Please sign in to comment.