#!/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>
#
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
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:" |
opath="${rpath}"
fi
done
- fi; done
+ done
}
#
# 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`