summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorfuzzyray <fuzzyray@gentoo.org>2010-02-04 15:59:37 +0000
committerfuzzyray <fuzzyray@gentoo.org>2010-02-04 15:59:37 +0000
commite9ea7b82eea3022ca4fc4cd1bfd970aff2e2c02a (patch)
tree34ed9747d47f0efd4f4982ae824610fd688310db /bin
parentcd69677390d7f9fbbbc8ab35009ce378a3c62abb (diff)
downloadgentoolkit-e9ea7b82eea3022ca4fc4cd1bfd970aff2e2c02a.tar.gz
Fix revdep-rebuild to parse include statements in /etc/ld.so.conf (Bug 298651). It will break with spaces in paths, so it needs a little bit more work before release.
svn path=/trunk/gentoolkit/; revision=739
Diffstat (limited to 'bin')
-rwxr-xr-xbin/revdep-rebuild23
1 files changed, 21 insertions, 2 deletions
diff --git a/bin/revdep-rebuild b/bin/revdep-rebuild
index c5f2538..55093cf 100755
--- a/bin/revdep-rebuild
+++ b/bin/revdep-rebuild
@@ -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