Hi,

On Fri, 2008-05-30 at 18:58 +0200, David Paleino wrote:
> I've adapted "wnpp-alert" by Arthur Korn <[EMAIL PROTECTED]>, so that it 
> checks
> whether a package has been ITPed or RFPed on the WNPP page -- and I've called
> it "wnpp-check".
> I'm attaching it to this mail -- I've been using it for a while with success, 
> I
> hope you will consider it for inclusion in the devscripts package :)

I've made a few small tweaks (see attached diff) and created a small man
page for the script.

>From my testing so far it seems to work fine and will likely get added
over the weekend.

Regards,

Adam
--- wnpp-check.sh	2008-05-31 00:36:52.000000000 +0100
+++ scripts/wnpp-check.sh	2008-05-31 00:38:24.000000000 +0100
@@ -9,17 +9,20 @@
 # Adapted from wnpp-alert, by Arthur Korn <[EMAIL PROTECTED]>
 
 PROGNAME=`basename $0`
-PACKAGES=$@
+PACKAGES="$@"
 
 usage () { echo \
-"Usage: $PROGNAME <package name>
+"Usage: $PROGNAME <package name> [...]
   -h,--help          Show this help message
   -v,--version       Show a version message
-List if a package has been ITPed, RFPed, or neither."
+
+  Check whether a package is listed as being packaged (ITPed) or has an
+  outstanding request for packaging (RFP) on the WNPP website
+  http://www.debian.org/devel/wnpp/";
 }
 
 version () { echo \
-"This is $PROGNAME, version 2.10.4
+"This is $PROGNAME, from the Debian devscripts package, version ###VERSION###
 This script is in the PUBLIC DOMAIN.
 Authors: David Paleino <[EMAIL PROTECTED]>
 Adapted from wnpp-alert, by Arthur Korn <[EMAIL PROTECTED]>,
@@ -38,9 +41,9 @@
 
 WNPP=`mktemp -t wnppcheck-wnpp.XXXXXX`
 WNPPTMP=`mktemp -t wnppcheck-wnpp.XXXXXX`
-trap "rm -f '$INSTALLED' '$WNPP' '$WNPPTMP'" 0 1 2 3 7 10 13 15
+trap "rm -f '$WNPP' '$WNPPTMP'" 0 1 2 3 7 10 13 15
 WNPP_PACKAGES=`mktemp -t wnppcheck-wnpp_packages.XXXXXX`
-trap "rm -f '$INSTALLED' '$WNPP' '$WNPPTMP' '$WNPP_PACKAGES'" \
+trap "rm -f '$WNPP' '$WNPPTMP' '$WNPP_PACKAGES'" \
   0 1 2 3 7 10 13 15
 
 # Here's a really sly sed script.  Rather than first grepping for
@@ -58,7 +61,10 @@
 
 awk -F' ' '{print $3" ("$1" - #"$2")"}' $WNPP | sort > $WNPP_PACKAGES
 
+NOTFOUND=1
 for pkg in $PACKAGES
 do
-	grep $pkg $WNPP_PACKAGES #&& echo $pkg
+    grep $pkg $WNPP_PACKAGES && NOTFOUND=0
 done
+
+exit $NOTFOUND

Reply via email to