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=/branches/gentoolkit-0.2.4/; revision=739

ChangeLog
src/revdep-rebuild/revdep-rebuild

index 0a1e272b9f54bb431dd78d7bd2092465f0aff115..378b6f6ba7b1a76242b2d82ad6fe3df9648babbf 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)
+
 2009-12-17: Paul Varner <fuzzyray@gentoo.org>
        * revdep-rebuild: Fix revdep-rebuild to properly honor
        PORTAGE_NICENESS as an incremental to the current nice level. (Bug
index 1dd10a950bf4046438f242ff2dc35e3c6384c3df..d694bc956fb98b7c3e527ba8131d19059d214959 100755 (executable)
@@ -636,6 +636,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
@@ -648,7 +667,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=':'
@@ -1020,7 +1039,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