merge tweaks from trunk
authorMike Frysinger <vapier@gentoo.org>
Tue, 1 Nov 2005 01:33:24 +0000 (01:33 -0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 1 Nov 2005 01:33:24 +0000 (01:33 -0000)
svn path=/main/branches/2.0/; revision=2224

bin/etc-update

index 24af6dccc5f69d522649dd15ab0d8d14647f55a5..8289d10779f0d899021803706fbf9c10cda6c82f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/etc-update,v 1.23.2.5 2005/05/29 12:40:08 jstubbs Exp $
+# $Id: etc-update 1912 2005-08-25 03:54:42Z ferringb $
 
 # Author Brandon Low <lostlogic@gentoo.org>
 #
@@ -12,8 +12,6 @@
 
 export PORTAGE_CALLER="etc-update"
 
-eval $(python -c 'import portage; print "export PORTAGE_TMPDIR="+portage.settings["PORTAGE_TMPDIR"];')
-
 if type -p gsed >/dev/null ; then
        function sed() { gsed "$@"; }
 fi
@@ -42,7 +40,9 @@ function scan() {
                exit 1
        fi
 
-       for path in ${CONFIG_PROTECT}; do if [ -d ${path} ]; then
+       for path in ${CONFIG_PROTECT} ; do
+               [ ! -d ${path} ] && continue
+
                ofile=""
                for file in `find ${path}/ -iname "._cfg????_*" |
                           sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
@@ -96,7 +96,7 @@ function scan() {
                                opath="${rpath}"
                        fi
                done
-       fi; done
+       done
 
 }
 
@@ -358,17 +358,19 @@ function die() {
 #
 # Run the script
 #
-scriptname=`basename $0`
+scriptname=$(basename $0)
 
 trap die term
 
+export PORTAGE_TMPDIR=$(/usr/lib/portage/bin/portageq envvar PORTAGE_TMPDIR)
+
 TMP="${PORTAGE_TMPDIR}/$$"
 rm -rf ${TMP} 2> /dev/null
 mkdir ${TMP} || die "failed mkdir command!" 1
 
 # I need the CONFIG_PROTECT value
-CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq config_protect)
-CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq config_protect_mask)
+CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT)
+CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK)
 
 # load etc-config's configuration
 EU_AUTOMERGE=`get_config eu_automerge`