summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-10-07 19:33:35 +0000
committerMike Frysinger <vapier@gentoo.org>2007-10-07 19:33:35 +0000
commit989d324ea91f6b225336ea01faf2866669609785 (patch)
treeb40cc9ba77c57457501d202e60043c030656c0cd
parent43230a52fe0ebd27ed996090ef18c7a6215bb66e (diff)
downloadportage-989d324ea91f6b225336ea01faf2866669609785.tar.gz
portage-989d324ea91f6b225336ea01faf2866669609785.tar.bz2
portage-989d324ea91f6b225336ea01faf2866669609785.zip
add --debug option and display a message about skipping non-files so we dont get confusing loops where portage claims there are things to update but etc-update claims there are not
svn path=/main/trunk/; revision=7994
-rwxr-xr-xbin/etc-update12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/etc-update b/bin/etc-update
index 73dfb6bf0..16fb1fae4 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -40,7 +40,6 @@ diff_command() {
}
scan() {
-
echo "Scanning Configuration files..."
rm -rf ${TMP}/files > /dev/null 2>&1
mkdir ${TMP}/files || die "Failed mkdir command!" 1
@@ -64,6 +63,7 @@ scan() {
for file in $(set -f; find ${path}/ ${find_opts} ! -iname '.*~' ! -iname '.*.bak' |
sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do
+
rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")
rfile=$(echo "${file/\/\///}" | sed -e "s:^.*/::")
for mpath in ${CONFIG_PROTECT_MASK}; do
@@ -74,8 +74,10 @@ scan() {
break
fi
done
- [ ! -f ${file} ] && continue
-
+ if [[ ! -f ${file} ]] ; then
+ echo "Skipping non-file ${file} ..."
+ continue
+ fi
if [[ "${ofile:10}" != "${rfile:10}" ]] ||
[[ ${opath} != ${rpath} ]]; then
@@ -452,6 +454,7 @@ usage() {
Usage: etc-update [options]
Options:
+ -d, --debug Enable shell debugging
-h, --help Show help and run away
-V, --version Show version and trundle away
EOF
@@ -465,14 +468,17 @@ usage() {
# Run the script
#
+SET_X=false
while [[ -n $1 ]] ; do
case $1 in
+ -d|--debug) SET_X=true;;
-h|--help) usage;;
-V|--version) echo '$Id$'; exit 0;;
*) usage 1 "Invalid option '$1'";;
esac
shift
done
+${SET_X} && set -x
type portageq > /dev/null || exit $?
eval $(portageq envvar -v CONFIG_PROTECT \