Fix revdep-rebuild to parse include statements in /etc/ld.so.conf (Bug 298651). It...
authorfuzzyray <fuzzyray@gentoo.org>
Thu, 4 Feb 2010 15:59:37 +0000 (15:59 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Thu, 4 Feb 2010 15:59:37 +0000 (15:59 -0000)
svn path=/trunk/gentoolkit/; revision=739

ChangeLog
bin/revdep-rebuild

index fb4f28e4f73138fa790304dd416d81a6a94d90bf..a5b7be2fd01b661d56d68e80bc9bf81b1824556e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-04: Paul Varner <fuzzyray@gentoo.org>
+       * revdep-rebuild: Fix revdep-rebuild to handle include statements in
+       /etc/ld.so.conf. (Bug 298651)
+
 2010-31-01: Christian Ruppert <idl0r@gentoo.org>
        * revdep-rebuild: Check for eerror in die() since an invalid option(long) or
        missing arg will end up in calling die() before /etc/init.d/functions.sh
 
 2009-08-18: Robert Buchholz <rbu@gentoo.org>
        * glsa-check: Remove 'new' target from glsa-list, everyone
-        should use 'affected' or 'all'
+       should use 'affected' or 'all'
        * glsa-check: fix getminupgrade API doc and TypeError (Bug 281101)
        * glsa-check: Make --pretend output in glsa-check nicer.
-        Add colors and fix linebreaks.
+       Add colors and fix linebreaks.
 
 2009-06-22: Paul Varner <fuzzyray@gentoo.org>
        * glsa-check: Fix traceback with glsa-check -f (Bug 275105)
index c5f253861b67e54684dc9028695d0a45377f3d2c..55093cf96359e60d1161f550a49fd75859bbde97 100755 (executable)
@@ -664,6 +664,25 @@ get_files() {
                einfo "Generated new $FILES_FILE"
        fi
 }
+parse_ld_so_conf() {
+       # FIXME: not safe for paths with spaces
+       local include
+       for path in $(sed '/^#/d;s/#.*$//' < /etc/ld.so.conf); do
+               if [[ $include = true ]]; then
+                       for include_path in $(sed '/^#/d;s/#.*$//' /etc/${path}); do
+                               echo $include_path
+                       done
+                       include=""
+                       continue
+               fi
+               if [[ $path != include ]]; then
+                       echo $path
+               else
+                       include="true"
+                       continue
+               fi
+       done
+}
 get_ldpath() {
        local COMPLETE_LD_LIBRARY_PATH
        [[ $SEARCH_BROKEN && $FULL_LD_PATH ]] || return
@@ -676,7 +695,7 @@ get_ldpath() {
                COMPLETE_LD_LIBRARY_PATH=(
                        /lib*
                        /usr/lib*
-                       $(sed '/^#/d;s/#.*$//' < /etc/ld.so.conf)
+                       $(parse_ld_so_conf)
                        $(sed 's:/[^/]*$::' < "$FILES_FILE" | sort -ru)
                )
                IFS=':'
@@ -1063,7 +1082,7 @@ setup_search_paths_and_masks() {
 
        # Get the directories from /etc/ld.so.conf
        if [[ -r /etc/ld.so.conf && -s /etc/ld.so.conf ]]; then
-               SEARCH_DIRS+=" "$(sed '/^#/d;s/#.*$//' /etc/ld.so.conf)
+               SEARCH_DIRS+=" "$(parse_ld_so_conf)
        fi
 
        # Set the final variables