summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-10 21:43:30 -0500
committerMike Frysinger <vapier@gentoo.org>2012-03-10 21:44:22 -0500
commit188aedeb2822f5c86a0586fd3350800565da5c6c (patch)
tree02c0a15c1b284bce60b6dd2a169db740d1fb7ed8
parentdispatch-conf: do regex matching ourselves (diff)
downloadportage-188aedeb2822f5c86a0586fd3350800565da5c6c.tar.gz
portage-188aedeb2822f5c86a0586fd3350800565da5c6c.tar.bz2
portage-188aedeb2822f5c86a0586fd3350800565da5c6c.zip
etc-update: support scan paths on the command line
URL: http://bugs.gentoo.org/59235 Reported-by: Cory Visi <merlin@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xbin/etc-update12
-rw-r--r--man/etc-update.15
2 files changed, 11 insertions, 6 deletions
diff --git a/bin/etc-update b/bin/etc-update
index 989d36793..c49c4b8f6 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -52,7 +52,7 @@ scan() {
local find_opts
local path
- for path in ${CONFIG_PROTECT} ; do
+ for path in ${SCAN_PATHS} ; do
path="${EROOT%/}${path}"
[[ -w ${path} ]] || die "Need write access to ${path}"
@@ -544,7 +544,9 @@ usage() {
cat <<-EOF
etc-update: Handle configuration file updates
- Usage: etc-update [options]
+ Usage: etc-update [options] [paths to scan]
+
+ If no paths are specified, then \${CONFIG_PROTECT} will be used.
Options:
-d, --debug Enable shell debugging
@@ -581,7 +583,8 @@ while [[ -n $1 ]] ; do
-v|--verbose) VERBOSE=true;;
-V|--version) emerge --version; exit 0;;
--automode) parse_automode_flag $2 && shift || usage 1 "Invalid mode '$2'";;
- *) usage 1 "Invalid option '$1'";;
+ -*) usage 1 "Invalid option '$1'";;
+ *) break;;
esac
shift
done
@@ -599,6 +602,7 @@ portage_vars=(
)
eval $(portageq envvar -v ${portage_vars[@]})
export PORTAGE_TMPDIR
+SCAN_PATHS=${*:-${CONFIG_PROTECT}}
TMP="${PORTAGE_TMPDIR}/etc-update-$$"
trap "die terminated" SIGTERM
@@ -663,7 +667,7 @@ else
fi
if ${VERBOSE} ; then
- for v in ${portage_vars[@]} ${cfg_vars[@]} TMP ; do
+ for v in ${portage_vars[@]} ${cfg_vars[@]} TMP SCAN_PATHS ; do
echo "${v}=${!v}"
done
fi
diff --git a/man/etc-update.1 b/man/etc-update.1
index bebef5b69..85d102d92 100644
--- a/man/etc-update.1
+++ b/man/etc-update.1
@@ -3,7 +3,7 @@
etc-update \- handle configuration file updates
.SH SYNOPSIS
.BR etc-update
-[\fIoptions\fR] [\fI--automode <mode>\fR]
+[\fIoptions\fR] [\fI--automode <mode>\fR] [\fIpaths to scan\fR]
.SH DESCRIPTION
.I etc-update
is supposed to be run after merging a new package to see if
@@ -13,7 +13,8 @@ configuration file will override an old one,
will prompt the user for a decision.
.PP
.I etc-update
-will check all directories in the \fICONFIG_PROTECT\fR variable. All
+will check all directories specified on the command line. If no paths
+are given, then the \fICONFIG_PROTECT\fR variable will be used. All
config files found in \fICONFIG_PROTECT_MASK\fR will automatically be
updated for you by \fIetc-update\fR. See \fBmake.conf\fR(5) for more
information.