r39383 - /scripts/qa/packagecheck

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sun Jul 5 15:10:35 UTC 2009


Author: gregoa
Date: Sun Jul  5 15:10:29 2009
New Revision: 39383

URL: http://svn.debian.org/wsvn/?sc=1&rev=39383
Log:
use 'grep -q' everywhere

Modified:
    scripts/qa/packagecheck

Modified: scripts/qa/packagecheck
URL: http://svn.debian.org/wsvn/scripts/qa/packagecheck?rev=39383&op=diff
==============================================================================
--- scripts/qa/packagecheck (original)
+++ scripts/qa/packagecheck Sun Jul  5 15:10:29 2009
@@ -98,7 +98,7 @@
 	DIR=$1
 	PKG=$(basename $($CMD_REALPATH $DIR))
 	# check for and add missing Vcs-Svn field
-	if ! grep ^Vcs-Svn $DIR/debian/control > /dev/null; then
+	if ! grep -q ^Vcs-Svn $DIR/debian/control; then
 		echo "$PKG: adding missing Vcs-Svn field"
 		perl -pi -e "s;(Standards-Version:.+);\$1\nVcs-Svn: svn://svn.debian.org/pkg-perl/trunk/$PKG/;" $DIR/debian/control
 		MSG_CONTROL_ADD="${MSG_CONTROL_ADD:+$MSG_CONTROL_ADD; }Vcs-Svn field (source stanza)"
@@ -106,7 +106,7 @@
 	fi
 
 	# check for Vcs-Browser field using WebSVN
-	if grep '^Vcs-Browser: http://svn.debian.org/wsvn' $DIR/debian/control > /dev/null; then
+	if grep -q '^Vcs-Browser: http://svn.debian.org/wsvn' $DIR/debian/control; then
 		echo "$PKG: switching Vcs-Browser field from WebSVN to ViewSVN"
 		perl -pi -e 's;^(Vcs-Browser: http://svn.debian.org/)wsvn(/pkg-perl/trunk/[^/]/?);$1viewsvn$2;' $DIR/debian/control
 		MSG_CONTROL_CH="${MSG_CONTROL_CH:+$MSG_CONTROL_CH; }Switched Vcs-Browser field to ViewSVN (source stanza)"
@@ -114,7 +114,7 @@
 	fi
 
 	# check for and add missing Vcs-Browser field
-	if ! grep ^Vcs-Browser $DIR/debian/control > /dev/null; then
+	if ! grep -q ^Vcs-Browser $DIR/debian/control; then
 		echo "$PKG: adding missing Vcs-Browser field"
 		perl -pi -e "s;(^Vcs-Svn:.+);\$1\nVcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/$PKG/;" $DIR/debian/control
 		MSG_CONTROL_ADD="${MSG_CONTROL_ADD:+$MSG_CONTROL_ADD; }Vcs-Browser field (source stanza)"
@@ -122,7 +122,7 @@
 	fi
 
 	# remove old XS-Vcs-(Svn|Browser) fields
-	if grep ^XS-Vcs- $DIR/debian/control > /dev/null; then
+	if grep -q ^XS-Vcs- $DIR/debian/control; then
 		echo "$PKG: removing old XS-Vcs-* fields"
 		sed -i -e '/^XS-Vcs-/ d' $DIR/debian/control
 		MSG_CONTROL_RM="${MSG_CONTROL_RM:+$MSG_CONTROL_RM; }XS-Vcs-Svn fields (source stanza)"
@@ -145,11 +145,11 @@
 	fi
 
 	# check for and add missing new Homepage to source stanza
-	if ! egrep "^Homepage: " $DIR/debian/control > /dev/null; then
+	if ! egrep -q "^Homepage: " $DIR/debian/control; then
 		echo "$PKG: trying to add missing Homepage field to source stanza"
 
 		# only construct new URL if we don't have a "real one"
-		if [ -z "$NEWHP" ] || echo "$NEWHP" | grep cpan\.org > /dev/null; then
+		if [ -z "$NEWHP" ] || echo "$NEWHP" | grep -q cpan\.org; then
 			PERLNAME=`detect_dist $DIR`
 			if [ -n "$PERLNAME" ]; then
 				NEWHP="http://search.cpan.org/dist/$PERLNAME/"
@@ -180,7 +180,7 @@
 		# keep old Maintainer in Uploaders unless it's the group in some other form
 		# TODO: remove DPG from Uploaders if we've added it to Maintainer
 		if ! echo $OLDMAINT | grep pkg-perl-maintainers ; then
-			if grep Uploaders $DIR/debian/control > /dev/null; then
+			if grep -q Uploaders $DIR/debian/control; then
 				perl -pi -e "BEGIN { our \$m=shift @ARGV }; s;(Uploaders:.+>)(.*);\$1, \$m\$2;" "$OLDMAINT" $DIR/debian/control
 			else
 				perl -pi -e "BEGIN { our \$m=shift @ARGV }; s;(Maintainer:.+);\$1\nUploaders: \$m;" "${OLDMAINT}" $DIR/debian/control
@@ -207,7 +207,7 @@
 	DIR=$1
 	PKG=$(basename $($CMD_REALPATH $DIR))
 	# watchfile
-	if [ -e $DIR/debian/watch ] && ! grep search\.cpan\.org/dist/ $DIR/debian/watch >/dev/null; then
+	if [ -e $DIR/debian/watch ] && ! grep -q search\.cpan\.org/dist/ $DIR/debian/watch; then
 		echo "$PKG: trying to change URL in debian/watch"
 		if perl -i -e "my \$changed=1; while(<>){ \$changed=0 if s{(?:^|\s+)(?:ht|f)tp://.*cpan.+/\s*(\S+)-(?:\S+)(\s.+)?$}{http://search.cpan.org/dist/\$1/   .*/\$1-v?(\\\\d[\\\\d.-]+)\\\\.(?:tar(?:\\\\.gz|\\\\.bz2)?|tgz|zip)\$2}i; print;} exit \$changed" $DIR/debian/watch ; then
 			perl -pi -e "s;^version=2;version=3;" $DIR/debian/watch
@@ -234,7 +234,7 @@
 	DIR=$1
 	PKG=$(basename $($CMD_REALPATH $DIR))
 	# handle rmdir /usr/{share,lib}/perl5
-	if egrep -m 1 -C 1 "(rmdir.*ignore-fail-on-non-empty|rm -r.*usr/(lib|share)(/perl5)?$)" $DIR/debian/rules | perl -pe 's/\n//g' | grep -v "\[ \! -d" > /dev/null ; then
+	if egrep -m 1 -C 1 "(rmdir.*ignore-fail-on-non-empty|rm -r.*usr/(lib|share)(/perl5)?$)" $DIR/debian/rules | perl -pe 's/\n//g' | grep -q -v "\[ \! -d"; then
 		ARCH=$(grep -m 1 -h "Architecture:" $DIR/debian/control | awk '{print $2;}')
 		case $ARCH in
 			any)
@@ -266,7 +266,7 @@
 	DIR=$1
 	PKG=$(basename $($CMD_REALPATH $DIR))
 	# add debian/README.source for quilt using packages
-	if grep --silent quilt $DIR/debian/control > /dev/null && [ ! -e $DIR/debian/README.source ] ; then
+	if grep -q quilt $DIR/debian/control && [ ! -e $DIR/debian/README.source ] ; then
 		echo "$PKG: adding debian/README.source"
 cat <<- EOF > $DIR/debian/README.source
 	This package uses quilt to manage all modifications to the upstream




More information about the Pkg-perl-cvs-commits mailing list