[devscripts] 03/06: wnpp-check: Add --exact switch
James McCoy
jamessan at debian.org
Mon Jul 27 06:28:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
jamessan pushed a commit to branch master
in repository devscripts.
commit b62b0c02182210cca96c56975fc61c78c90bf0f3
Author: James McCoy <jamessan at debian.org>
Date: Sun Jul 26 21:22:24 2015 -0400
wnpp-check: Add --exact switch
Closes: #791918
Signed-off-by: James McCoy <jamessan at debian.org>
---
debian/changelog | 2 ++
scripts/wnpp-check.1 | 5 ++++-
scripts/wnpp-check.sh | 12 +++++++++---
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 2b32536..c4a8de4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,8 @@ devscripts (2.15.6) UNRELEASED; urgency=medium
#788707)
* wnpp-check:
+ Use getopt to handle argument parsing.
+ + Add --exact switch to match the exact package name instead of a
+ substring. Thanks to Balasankar C. (Closes: #791918)
[ Dominique Dumont ]
* licensecheck:
diff --git a/scripts/wnpp-check.1 b/scripts/wnpp-check.1
index c04f61b..87df535 100644
--- a/scripts/wnpp-check.1
+++ b/scripts/wnpp-check.1
@@ -2,7 +2,7 @@
.SH NAME
wnpp-check \- check if a package is being packaged or if this has been requested
.SH SYNOPSIS
-\fBwnpp-check \fIpackage \fR...
+\fBwnpp-check [\fB\-\-exact\fR] \fIpackage \fR...
.br
\fBwnpp-check \-\-help\fR|\fB\-\-version\fR
.SH DESCRIPTION
@@ -20,6 +20,9 @@ Show a summary of options.
.TP
.BR \-\-version ", " \-v
Show version and copyright information.
+.TP
+.BR \-\-exact ", " \-e
+Require an exact package name match, rather than the default substring match.
.SH SEE ALSO
https://www.debian.org/devel/wnpp
.SH EXIT STATUS
diff --git a/scripts/wnpp-check.sh b/scripts/wnpp-check.sh
index 3adf8c1..f134777 100755
--- a/scripts/wnpp-check.sh
+++ b/scripts/wnpp-check.sh
@@ -12,6 +12,7 @@ set -e
CURLORWGET=""
GETCOMMAND=""
+EXACT=0
PROGNAME=${0##*/}
usage () { echo \
@@ -32,8 +33,8 @@ Adapted from wnpp-alert, by Arthur Korn <arthur at korn.ch>,
with modifications by Julian Gilbey <jdg at debian.org>"
}
-TEMP=$(getopt -n "$PROGNAME" -o 'hv' \
- -l 'help,version' \
+TEMP=$(getopt -n "$PROGNAME" -o 'hve' \
+ -l 'help,version,exact' \
-- "$@") || (rc=$?; usage >&2; exit $rc)
eval set -- "$TEMP"
@@ -43,6 +44,7 @@ do
case "$1" in
-h|--help) usage; exit 0 ;;
-v|--version) version; exit 0 ;;
+ -e|--exact) EXACT=1 ;;
--) shift; break ;;
esac
shift
@@ -91,7 +93,11 @@ awk -F' ' '{print "("$1" - #"$2") http://bugs.debian.org/"$2" "$3}' $WNPP | sort
FOUND=0
for pkg in $PACKAGES
do
- grep $pkg $WNPP_PACKAGES && FOUND=1
+ if [ $EXACT != 1 ]; then
+ grep $pkg $WNPP_PACKAGES && FOUND=1
+ else
+ grep " $pkg$" $WNPP_PACKAGES && FOUND=1
+ fi
done
exit $FOUND
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git
More information about the devscripts-devel
mailing list