summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/etc-update20
1 files changed, 11 insertions, 9 deletions
diff --git a/bin/etc-update b/bin/etc-update
index 24af6dccc..8289d1077 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -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`