[SCM] Debian Qt/KDE packaging tools branch, master, updated. debian/0.5.2
Modestas Vainius
modax-guest at alioth.debian.org
Fri Oct 16 20:27:46 UTC 2009
The following commit has been merged in the master branch:
commit 6377712b283055ad2fa12b4e75e34156bbc40cb8
Author: Modestas Vainius <modestas at vainius.eu>
Date: Fri Oct 16 23:19:20 2009 +0300
Add common option -n to pkgkde-vcs.
The option enables "dry-run" mode. I.e. do not run any external commands that
make changes to the repository. Useful with -v to see what commands with what
options would be run.
---
vcs/pkgkde-vcs | 15 ++++++++++-----
vcs/pkgkde-vcs.1 | 4 ++++
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/vcs/pkgkde-vcs b/vcs/pkgkde-vcs
index 08dc6cb..88cea36 100755
--- a/vcs/pkgkde-vcs
+++ b/vcs/pkgkde-vcs
@@ -62,10 +62,10 @@ determine_libdir()
runcmd()
{
local ans exitval
- if [ -n "$OPT_VERBOSE" ] || [ -z "$OPT_YES" ]; then
+ if [ -n "$OPT_VERBOSE" ] || [ "$OPT_PROMPT" = "prompt" ]; then
echo "$" "$*" >&2
fi
- if [ -z "$OPT_YES" ]; then
+ if [ "$OPT_PROMPT" = "prompt" ]; then
echo -n "Run the command above? [Y/n]: "
while true; do
read ans
@@ -80,6 +80,10 @@ runcmd()
done
fi
+ if [ "$OPT_PROMPT" = "n" ]; then
+ return 0
+ fi
+
# Run the command
"$@"
exitval="$?"
@@ -135,12 +139,13 @@ is_distribution_valid()
# Parse common options
OPT_VERBOSE=
-OPT_YES=
+OPT_PROMPT='prompt'
-while getopts ":vy" name; do
+while getopts ":vyn" name; do
case "$name" in
v) OPT_VERBOSE=1 ;;
- y) OPT_YES=1 ;;
+ y) OPT_PROMPT='y' ;;
+ n) OPT_PROMPT='n' ;;
?) if [ -n "$OPTARG" ]; then OPTIND=$(($OPTIND-1)); fi; break;;
:) die "$OPTARG option is missing a required argument" ;;
esac
diff --git a/vcs/pkgkde-vcs.1 b/vcs/pkgkde-vcs.1
index ae1c354..e071e39 100644
--- a/vcs/pkgkde-vcs.1
+++ b/vcs/pkgkde-vcs.1
@@ -47,6 +47,10 @@ By default, execution of each external command that makes changes to the
repository has to be explicitly confirmed by user. However, if this option is
specified, command will be run without confirmation.
.TP
+.B \-n
+Do not run any external commands that make changes to the repository. Useful
+with \fB\-v\fR to see what commands with what options would be run.
+.TP
.B \-v
Be more verbose (e.g. show external commands as they are executed).
.TP
--
Debian Qt/KDE packaging tools
More information about the pkg-kde-commits
mailing list