use eval to allow shell expansion in config file
authorMarius Mauch <genone@gentoo.org>
Wed, 19 Jul 2006 11:10:31 +0000 (11:10 -0000)
committerMarius Mauch <genone@gentoo.org>
Wed, 19 Jul 2006 11:10:31 +0000 (11:10 -0000)
svn path=/main/trunk/; revision=3935

bin/etc-update

index 5f237ee539ed819179a54afa362526e0dae82daf..d0b7b7b1849d7b6b12be30251f74956a13e3a7e0 100755 (executable)
@@ -20,8 +20,10 @@ function get_config() {
        # First strip off comment lines, then grab the configuration
        # item. If there's more than one of the same configuration item,
        # then allow the last setting to take precedence.
-       cut -d'#' -f1-1 /etc/etc-update.conf | \
-               sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p" |sed -e '$p;d'
+       local result
+       result=$(cut -d'#' -f1-1 /etc/etc-update.conf | \
+               sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p" |sed -e '$p;d')
+       eval echo $result
 }
 
 function scan() {
@@ -399,9 +401,9 @@ trap die term
 
 eval $(/usr/lib/portage/bin/portageq envvar -v PORTAGE_TMPDIR CONFIG_PROTECT CONFIG_PROTECT_MASK)
 export PORTAGE_TMPDIR
-echo $PORTAGE_TMPDIR
-echo $CONFIG_PROTECT
-echo $CONFIG_PROTECT_MASK
+#echo $PORTAGE_TMPDIR
+#echo $CONFIG_PROTECT
+#echo $CONFIG_PROTECT_MASK
 #export PORTAGE_TMPDIR=$(/usr/lib/portage/bin/portageq envvar PORTAGE_TMPDIR)
 
 TMP="${PORTAGE_TMPDIR}/$$"