aboutsummaryrefslogtreecommitdiff
path: root/src
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
commite651df1d44c0e3236e4ec74d459cbffe0be2df75 (patch)
tree1658803ac70e90a45246691c35a470cf9a1118d3 /src
parentFix revdep-rebuild to properly honor PORTAGE_NICENESS as an incremental to th... (diff)
downloadgentoolkit-e651df1d44c0e3236e4ec74d459cbffe0be2df75.tar.gz
gentoolkit-e651df1d44c0e3236e4ec74d459cbffe0be2df75.tar.bz2
gentoolkit-e651df1d44c0e3236e4ec74d459cbffe0be2df75.zip
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=/branches/gentoolkit-0.2.4/; revision=739
Diffstat (limited to 'src')
-rwxr-xr-xsrc/revdep-rebuild/revdep-rebuild23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/revdep-rebuild/revdep-rebuild b/src/revdep-rebuild/revdep-rebuild
index 1dd10a9..d694bc9 100755
--- a/src/revdep-rebuild/revdep-rebuild
+++ b/src/revdep-rebuild/revdep-rebuild
@@ -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