Set environment using 'portageq -v' (Bug 300229)
authorfuzzyray <fuzzyray@gentoo.org>
Mon, 11 Jan 2010 16:36:38 +0000 (16:36 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Mon, 11 Jan 2010 16:36:38 +0000 (16:36 -0000)
svn path=/trunk/gentoolkit/; revision=734

ChangeLog
bin/revdep-rebuild

index c68aef3b6d5b668d8672ceb096c2df8312eca329..00b0b339627fa899c0bae7c1fa309443c6baeeaa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2009-01-11: Paul Varner <fuzzyray@gentoo.org>
+       * revdep-rebuild: Set environment using 'portageq -v' (Bug 300229)
+
 2009-01-08: Paul Varner <fuzzyray@gentoo.org>
        * epkginfo/equery: Fix expkinfo to not traceback if herds.xml is not
        present in the tree. (Bug 300108)
index b6d80e6d983b0943c5f5bd4fbf9994e89a6b56f1..ce9e61c0f347b33f0c1ee88d6d3445994cf07a94 100755 (executable)
@@ -985,30 +985,19 @@ show_unowned_files() {
 
 # Get multiple portage variables at once to speedup revdep-rebuild.
 portage_settings() {
-       local results=()
+       local ORIG_SEARCH_DIRS="$SEARCH_DIRS"
+       local ORIG_SEARCH_DIRS_MASK="$SEARCH_DIRS_MASK"
+       local ORIG_LD_LIBRARY_MASK="$LD_LIBRARY_MASK"
+       unset SEARCH_DIRS
+       unset SEARCH_DIRS_MASK
+       unset LD_LIBRARY_MASK
 
-       local query_vars=(
-               ROOT
-               PORTAGE_NICENESS
-               EMERGE_DEFAULT_OPTS
-               NOCOLOR
-               SEARCH_DIRS
-               SEARCH_DIRS_MASK
-               LD_LIBRARY_MASK
-       )
-
-       # one value per line
-       IFS=$'\n'
-       results=( $(unset SEARCH_DIRS; unset SEARCH_DIRS_MASK; unset LD_LIBRARY_MASK; portageq envvar ${query_vars[*]}) )
-       IFS=$OIFS
+       eval $(portageq envvar -v PORTAGE_ROOT PORTAGE_NICENESS EMERGE_DEFAULT_OPTS NOCOLOR SEARCH_DIRS SEARCH_DIRS_MASK LD_LIBRARY_MASK)
+       export NOCOLOR
 
-       PORTAGE_ROOT=${results[0]}
-       PORTAGE_NICENESS=${results[1]}
-       EMERGE_DEFAULT_OPTS=${results[2]}
-       export NOCOLOR=${results[3]}
-       SEARCH_DIRS+=" "${results[4]}
-       SEARCH_DIRS_MASK+=" "${results[5]}
-       LD_LIBRARY_MASK+=" "${results[6]}
+       SEARCH_DIRS="$ORIG_SEARCH_DIRS $SEARCH_DIRS"
+       SEARCH_DIRS_MASK="$ORIG_SEARCH_DIRS_MASK $SEARCH_DIRS_MASK"
+       LD_LIBRARY_MASK="$ORIG_LD_LIBRARY_MASK $LD_LIBRARY_MASK"
 }
 
 ##