r13851 - /scripts/qa/packagecheck

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Tue Jan 29 23:46:07 UTC 2008


Author: gregoa-guest
Date: Tue Jan 29 23:46:06 2008
New Revision: 13851

URL: http://svn.debian.org/wsvn/?sc=1&rev=13851
Log:
packagecheck: cosmetics: copyright year, capitalization, command substitution, watchfile changelog message

Modified:
    scripts/qa/packagecheck

Modified: scripts/qa/packagecheck
URL: http://svn.debian.org/wsvn/scripts/qa/packagecheck?rev=13851&op=diff
==============================================================================
--- scripts/qa/packagecheck (original)
+++ scripts/qa/packagecheck Tue Jan 29 23:46:06 2008
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # Copyright 2007, 2008 gregor herrmann <gregor+debian at comodo.priv.at>
-# Copyright 2007 Damyan Ivanov <dmn at debian.org>
+# Copyright 2007, 2008 Damyan Ivanov <dmn at debian.org>
 # Copyright 2007 David Paleino <d.paleino at gmail.com>
 # Released under the terms of the GNU GPL version 2
 #
@@ -35,7 +35,7 @@
 	echo "  -C       - if -W is given, create debian/watch if it does not"
 	echo "             exist"
 	echo
-  echo "  -p <pkg> - check only package <pkg>"
+	echo "  -p <pkg> - check only package <pkg>"
 	echo "  -h       - this help"
 	echo "  -c       - test only the package that is checked out in the"
 	echo "             current working directory"
@@ -44,17 +44,17 @@
 
 # given source directory, try to find out the cannonical distribution name
 detect_dist() {
-	dir=$1
+	DIR=$1
 	local PERLNAME
 	PERLNAME=''
-	if [ -s $dir/Build.PL ]; then
-		PERLNAME=$(perl -n -e "print if s;^.*module_name.*=>.*['\"[]([a-zA-Z0-9:_-]+)[]'\"].*\$;\$1;" $dir/Build.PL | sed -e 's/::/-/g' | head -n 1)
-	fi
-	if [ -s $dir/Makefile.PL ]; then
-		PERLNAME=$(perl -n -e "print if s;^.*(?:DIST)?NAME.*=>.*['\"[]([a-zA-Z0-9:_-]+)[]'\"].*\$;\$1;" $dir/Makefile.PL | sed -e 's/::/-/g' | head -n 1)
-	fi
-	if [ -s $dir/META.yml ]; then
-		PERLNAME=$(perl -n -e "print if s;^name:.* ([a-zA-Z0-9:_-]+).*\$;\$1;" $dir/META.yml | head -n 1)
+	if [ -s $DIR/Build.PL ]; then
+		PERLNAME=$(perl -n -e "print if s;^.*module_name.*=>.*['\"[]([a-zA-Z0-9:_-]+)[]'\"].*\$;\$1;" $DIR/Build.PL | sed -e 's/::/-/g' | head -n 1)
+	fi
+	if [ -s $DIR/Makefile.PL ]; then
+		PERLNAME=$(perl -n -e "print if s;^.*(?:DIST)?NAME.*=>.*['\"[]([a-zA-Z0-9:_-]+)[]'\"].*\$;\$1;" $DIR/Makefile.PL | sed -e 's/::/-/g' | head -n 1)
+	fi
+	if [ -s $DIR/META.yml ]; then
+		PERLNAME=$(perl -n -e "print if s;^name:.* ([a-zA-Z0-9:_-]+).*\$;\$1;" $DIR/META.yml | head -n 1)
 	fi
 	if [ -n "$PERLNAME" ]; then
 		if curl --silent http://search.cpan.org/dist/$PERLNAME/ | grep '<title>.*</title>' | grep --silent $PERLNAME; then
@@ -64,50 +64,50 @@
 }
 
 testvcs() {
-	dir=$1
-	pkg=`basename \`realpath $dir\``
+	DIR=$1
+	PKG=$(basename $(realpath $DIR))
 	# check for and add missing Vcs-Svn field
-	if ! grep ^Vcs-Svn $dir/debian/control > /dev/null; 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
+	if ! grep ^Vcs-Svn $DIR/debian/control > /dev/null; 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)"
 		CHANGED=1
 	fi
 
 	# check for and add missing Vcs-Browser field
-	if ! grep ^Vcs-Browser $dir/debian/control > /dev/null; then
-		echo "$pkg: adding missing Vcs-Browser field"
-		perl -pi -e "s;(^Vcs-Svn:.+);\$1\nVcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/$pkg/;" $dir/debian/control
+	if ! grep ^Vcs-Browser $DIR/debian/control > /dev/null; then
+		echo "$PKG: adding missing Vcs-Browser field"
+		perl -pi -e "s;(^Vcs-Svn:.+);\$1\nVcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/$PKG/;" $DIR/debian/control
 		MSG_CONTROL_ADD="${MSG_CONTROL_ADD:+$MSG_CONTROL_ADD; }Vcs-Browser field (source stanza)"
 		CHANGED=1
 	fi
 
 	# remove old XS-Vcs-(Svn|Browser) fields
-	if grep ^XS-Vcs- $dir/debian/control > /dev/null; then
-		echo "$pkg: removing old XS-Vcs-* fields"
-		sed -i -e '/^XS-Vcs-/ d' $dir/debian/control
+	if grep ^XS-Vcs- $DIR/debian/control > /dev/null; 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)"
 		CHANGED=1
 	fi
 }
 
 testhomepage() {
-	dir=$1
-	pkg=`basename \`realpath $dir\``
+	DIR=$1
+	PKG=$(basename $(realpath $DIR))
 	# check for and remove old Homepage from long description
-	OLDHP=$(egrep "^  Homepage: " $dir/debian/control | egrep -o "http.+")
+	OLDHP=$(egrep "^  Homepage: " $DIR/debian/control | egrep -o "http.+")
 	if [ -n "$OLDHP" ] ; then
-		echo "$pkg: removing Homepage: pseudo-field from Description"
-		perl -e "undef \$/; my \$buf=<STDIN>; \$buf =~ s/\n \.\n  Homepage: .*//; print \$buf" < $dir/debian/control > $dir/debian/control.new
-		mv $dir/debian/control.new $dir/debian/control
+		echo "$PKG: removing Homepage: pseudo-field from Description"
+		perl -e "undef \$/; my \$buf=<STDIN>; \$buf =~ s/\n \.\n  Homepage: .*//; print \$buf" < $DIR/debian/control > $DIR/debian/control.new
+		mv $DIR/debian/control.new $DIR/debian/control
 		MSG_CONTROL_RM="${MSG_CONTROL_RM:+$MSG_CONTROL_RM; }Homepage pseudo-field (Description)"
 		CHANGED=1
 		NEWHP=$OLDHP
 	fi
 
 	# check for and add missing new Homepage to source stanza
-	if ! egrep "^Homepage: " $dir/debian/control > /dev/null; then
-		echo "$pkg: trying to add missing Homepage field to source stanza"
+	if ! egrep "^Homepage: " $DIR/debian/control > /dev/null; 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
@@ -121,7 +121,7 @@
 		fi
 		
 		if [ -n "$NEWHP" ]; then
-			perl -pi -e "s;(Standards-Version:.+);\$1\nHomepage: $NEWHP;" $dir/debian/control
+			perl -pi -e "s;(Standards-Version:.+);\$1\nHomepage: $NEWHP;" $DIR/debian/control
 			MSG_CONTROL_ADD="${MSG_CONTROL_ADD:+$MSG_CONTROL_ADD; }Homepage field (source stanza)"
 			CHANGED=1
 		fi
@@ -130,21 +130,21 @@
 }
 
 testmaintainer() {
-	dir=$1
-	pkg=`basename \`realpath $dir\``
+	DIR=$1
+	PKG=$(basename $(realpath $DIR))
 	# get Maintainer, check and change
-	OLDMAINT=$(grep ^Maintainer: $dir/debian/control | cut -f2- -d" ")
+	OLDMAINT=$(grep ^Maintainer: $DIR/debian/control | cut -f2- -d" ")
 	if [ "$OLDMAINT" != "Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>" ] ; then
-		echo "$pkg: setting Maintainer to Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>"
-		perl -pi -e "s;^Maintainer:.+;Maintainer: Debian Perl Group <pkg-perl-maintainers\@lists.alioth.debian.org>;" $dir/debian/control
+		echo "$PKG: setting Maintainer to Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>"
+		perl -pi -e "s;^Maintainer:.+;Maintainer: Debian Perl Group <pkg-perl-maintainers\@lists.alioth.debian.org>;" $DIR/debian/control
 		MSG_CONTROL_CH="${MSG_CONTROL_CH:+$MSG_CONTROL_CH; }Maintainer set to Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org> (was: $OLDMAINT)"
 		# 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
-				perl -pi -e "BEGIN { our \$m=shift @ARVG }; s;(Uploaders:.+);\$1, \$m;" "$OLDMAINT" $dir/debian/control
+			if grep Uploaders $DIR/debian/control > /dev/null; then
+				perl -pi -e "BEGIN { our \$m=shift @ARVG }; s;(Uploaders:.+);\$1, \$m;" "$OLDMAINT" $DIR/debian/control
 			else
-				perl -pi -e "BEGIN { our \$m=shift @ARGV }; s;(Maintainer:.+);\$1\nUploaders: \$m;" "${OLDMAINT}" $dir/debian/control
+				perl -pi -e "BEGIN { our \$m=shift @ARGV }; s;(Maintainer:.+);\$1\nUploaders: \$m;" "${OLDMAINT}" $DIR/debian/control
 			fi
 			MSG_CONTROL_CH="${MSG_CONTROL_CH:+$MSG_CONTROL_CH; }$OLDMAINT moved to Uploaders"
 		fi
@@ -153,25 +153,25 @@
 }
 
 testwatchdist() {
-	dir=$1
-	pkg=`basename \`realpath $dir\``
+	DIR=$1
+	PKG=$(basename $(realpath $DIR))
 	# watchfile
-	if [ -e $dir/debian/watch ] && ! grep search\.cpan\.org/dist/ $dir/debian/watch >/dev/null; 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
+	if [ -e $DIR/debian/watch ] && ! grep search\.cpan\.org/dist/ $DIR/debian/watch >/dev/null; 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
 			MSG_WATCH="debian/watch: use dist-based URL."
 			CHANGED=1
 		fi
-	elif [ ! -e $dir/debian/watch ] && [ -n "$CREATE_WATCH" ]; then
-		echo "$pkg: creating debian/watch"
-		if dist_name=`detect_dist $dir`; then
+	elif [ ! -e $DIR/debian/watch ] && [ -n "$CREATE_WATCH" ]; then
+		echo "$PKG: creating debian/watch"
+		if dist_name=`detect_dist $DIR`; then
 			version_re='v?(\d[\d_.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)'
-			echo "version=3" > $dir/debian/watch
-			echo "http://search.cpan.org/dist/$dist_name/  .+/$dist_name-$version_re\$" >> $dir/debian/watch
-			svn add $dir/debian/watch
-
-			MSG_WATCH="added debian/watch"
+			echo "version=3" > $DIR/debian/watch
+			echo "http://search.cpan.org/dist/$dist_name/  .+/$dist_name-$version_re\$" >> $DIR/debian/watch
+			svn add $DIR/debian/watch
+
+			MSG_WATCH="Add debian/watch."
 			CHANGED=1
 		else
 			echo "ERROR: unable to find distribution name"
@@ -180,11 +180,11 @@
 }
 
 testrmdir() {
-	dir=$1
-	pkg=`basename \`realpath $dir\``
+	DIR=$1
+	PKG=$(basename $(realpath $DIR))
 	# handle rmdir /usr/{share,lib}/perl5
-	if egrep -m 1 "(rmdir.*ignore-fail-on-non-empty|rm -r.*usr/(lib|share)(/perl5)?$)" $dir/debian/rules | grep -v "\[ \! -d" > /dev/null ; then
-		ARCH=$(grep -m 1 -h "Architecture:" $dir/debian/control | awk '{print $2;}')
+	if egrep -m 1 "(rmdir.*ignore-fail-on-non-empty|rm -r.*usr/(lib|share)(/perl5)?$)" $DIR/debian/rules | grep -v "\[ \! -d" > /dev/null ; then
+		ARCH=$(grep -m 1 -h "Architecture:" $DIR/debian/control | awk '{print $2;}')
 		case $ARCH in
 			any)
 				DELDIR="/share/perl5"
@@ -195,12 +195,12 @@
 			*)
 				;;
 		esac
-		echo "$pkg: trying to make rmdir /usr${DELDIR} conditional"
-		if perl -i -e "my \$changed=1; while(<>){ \$changed=0 if s{rmdir.*ignore-fail-on-non-empty.*\s(\S+)$DELDIR}{[ ! -d \$1${DELDIR} ] || rmdir --ignore-fail-on-non-empty --parents --verbose \$1${DELDIR}}; print;} exit \$changed" $dir/debian/rules ; then
+		echo "$PKG: trying to make rmdir /usr${DELDIR} conditional"
+		if perl -i -e "my \$changed=1; while(<>){ \$changed=0 if s{rmdir.*ignore-fail-on-non-empty.*\s(\S+)$DELDIR}{[ ! -d \$1${DELDIR} ] || rmdir --ignore-fail-on-non-empty --parents --verbose \$1${DELDIR}}; print;} exit \$changed" $DIR/debian/rules ; then
 			MSG_RULES="debian/rules: delete /usr${DELDIR} only if it exists." && \
 			CHANGED=1
 		fi
-		if perl -i -e "my \$changed=1; while(<>){ \$changed=0 if s{-?rm -r.* (.*usr)/(?:lib|share)(?:/perl5)?\$}{[ ! -d \$1${DELDIR} ] || rmdir --ignore-fail-on-non-empty --parents --verbose \$1${DELDIR}}; print;} exit \$changed" $dir/debian/rules ; then
+		if perl -i -e "my \$changed=1; while(<>){ \$changed=0 if s{-?rm -r.* (.*usr)/(?:lib|share)(?:/perl5)?\$}{[ ! -d \$1${DELDIR} ] || rmdir --ignore-fail-on-non-empty --parents --verbose \$1${DELDIR}}; print;} exit \$changed" $DIR/debian/rules ; then
 			MSG_RULES="debian/rules: delete /usr${DELDIR} only if it exists." && \
 			CHANGED=1
 		fi




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