r8059 - /scripts/qa/packagecheck

hanska-guest at users.alioth.debian.org hanska-guest at users.alioth.debian.org
Wed Oct 3 20:12:28 UTC 2007


Author: hanska-guest
Date: Wed Oct  3 20:12:28 2007
New Revision: 8059

URL: http://svn.debian.org/wsvn/?sc=1&rev=8059
Log:
Having a more general approach

Modified:
    scripts/qa/packagecheck

Modified: scripts/qa/packagecheck
URL: http://svn.debian.org/wsvn/scripts/qa/packagecheck?rev=8059&op=diff
==============================================================================
--- scripts/qa/packagecheck (original)
+++ scripts/qa/packagecheck Wed Oct  3 20:12:28 2007
@@ -7,22 +7,22 @@
 # 1) Checks for and adds missing XS-Vcs-(Svn|Browser) fields 
 # 2) Checks for Homepage: field
 # in all debian/control files in trunk/
-# To be run one directory above trunk/
+# To be run into trunk/ (which might have any name now -- David Paleino)
 
 CHANGED=0
 
-echo "Running svn up trunk/ ..."
-svn up trunk/
+echo "Running svn up ..."
+svn up
 
-echo "Checking if trunk/ is clean ..."
-UNCLEAN=$(svn st trunk|egrep -v '^\?')
+echo "Checking if `pwd` is clean ..."
+UNCLEAN=$(svn st |egrep -v '^\?')
 if [ -n "$UNCLEAN" ]; then
     echo "$UNCLEAN"
-    echo WARNING: trunk is not clean
+    echo WARNING: `pwd` is not clean
 fi
 
 echo "Grepping through packages ..."
-for p in $(svn ls trunk); do 
+for p in $(svn ls); do 
   
   # 0) reset variables
   p=${p%/}
@@ -31,45 +31,45 @@
   NEWHP=
   
   # 1) check for and add missing XS-Vcs-Svn field
-	if ! grep XS-Vcs-Svn trunk/$p/debian/control > /dev/null; then
+	if ! grep XS-Vcs-Svn $p/debian/control > /dev/null; then
 		echo "$p: adding missing XS-Vcs-Svn field"
-		perl -pi -e "s;(Standards-Version:.+);\$1\nXS-Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/$p/;" trunk/$p/debian/control
-		dch --release-heuristic=changelog --changelog trunk/$p/debian/changelog "Add missing XS-Vcs-Svn field to debian/control."
+		perl -pi -e "s;(Standards-Version:.+);\$1\nXS-Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/$p/;" $p/debian/control
+		dch --release-heuristic=changelog --changelog $p/debian/changelog "Add missing XS-Vcs-Svn field to debian/control."
 		CHANGED=1
 	fi
 
   # 2) check for and add missing XS-Vcs-Browser field
-	if ! grep XS-Vcs-Browser trunk/$p/debian/control > /dev/null; then
+	if ! grep XS-Vcs-Browser $p/debian/control > /dev/null; then
 		echo "$p: adding missing XS-Vcs-Browser field"
-		perl -pi -e "s;(XS-Vcs-Svn:.+);\$1\nXS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/$p/;" trunk/$p/debian/control
-		dch --release-heuristic=changelog --changelog trunk/$p/debian/changelog "Add missing XS-Vcs-Browser field to debian/control."
+		perl -pi -e "s;(XS-Vcs-Svn:.+);\$1\nXS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/$p/;" $p/debian/control
+		dch --release-heuristic=changelog --changelog $p/debian/changelog "Add missing XS-Vcs-Browser field to debian/control."
 		CHANGED=1
 	fi
 
 	# 3) check for and remove old Homepage from long description
-	OLDHP=$(egrep "^  Homepage: " trunk/$p/debian/control | egrep -o "http.+")
+	OLDHP=$(egrep "^  Homepage: " $p/debian/control | egrep -o "http.+")
 	if [ -n "$OLDHP" ] ; then
 		echo "$p: removing Homepage: pseudo-field from Description"
-		perl -e "undef \$/; my \$buf=<STDIN>; \$buf =~ s/\n \.\n  Homepage: .*//; print \$buf" < trunk/$p/debian/control > trunk/$p/debian/control.new
-		mv trunk/$p/debian/control.new trunk/$p/debian/control
-		dch --release-heuristic=changelog --changelog trunk/$p/debian/changelog "Remove Homepage: pseudo-field from Description in debian/control."
+		perl -e "undef \$/; my \$buf=<STDIN>; \$buf =~ s/\n \.\n  Homepage: .*//; print \$buf" < $p/debian/control > $p/debian/control.new
+		mv $p/debian/control.new $p/debian/control
+		dch --release-heuristic=changelog --changelog $p/debian/changelog "Remove Homepage: pseudo-field from Description in debian/control."
 		CHANGED=1
 		NEWHP=$OLDHP
 	fi
   
   # 4) check for and add missing new Homepage to source stanza
-	if ! egrep "^Homepage: " trunk/$p/debian/control > /dev/null; then
+	if ! egrep "^Homepage: " $p/debian/control > /dev/null; then
 		echo "$p: trying to add missing Homepage field to source stanza"
 		
 		# try to construct canonical URL
-		if [ -s trunk/$p/Build.PL ]; then 
-			PERLNAME=$(perl -n -e "print if s;^.*module_name.*=>.*['\"[]([a-zA-Z0-9:_-]+)[]'\"].*\$;\$1;" trunk/$p/Build.PL | sed -e 's/::/-/g' | head -n 1)
+		if [ -s $p/Build.PL ]; then 
+			PERLNAME=$(perl -n -e "print if s;^.*module_name.*=>.*['\"[]([a-zA-Z0-9:_-]+)[]'\"].*\$;\$1;" $p/Build.PL | sed -e 's/::/-/g' | head -n 1)
 		fi
-		if [ -s trunk/$p/Makefile.PL ]; then 
-			PERLNAME=$(perl -n -e "print if s;^.*(?:DIST)?NAME.*=>.*['\"[]([a-zA-Z0-9:_-]+)[]'\"].*\$;\$1;" trunk/$p/Makefile.PL | sed -e 's/::/-/g' | head -n 1)
+		if [ -s $p/Makefile.PL ]; then 
+			PERLNAME=$(perl -n -e "print if s;^.*(?:DIST)?NAME.*=>.*['\"[]([a-zA-Z0-9:_-]+)[]'\"].*\$;\$1;" $p/Makefile.PL | sed -e 's/::/-/g' | head -n 1)
 		fi
-		if [ -s trunk/$p/META.yml ]; then 
-			PERLNAME=$(perl -n -e "print if s;^name:.* ([a-zA-Z0-9:_-]+).*\$;\$1;" trunk/$p/META.yml | head -n 1)
+		if [ -s $p/META.yml ]; then 
+			PERLNAME=$(perl -n -e "print if s;^name:.* ([a-zA-Z0-9:_-]+).*\$;\$1;" $p/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
@@ -80,8 +80,8 @@
 		# get NEWHP from somewhere else? debian/watch? debian/copyright?
 
 		if [ -n "$NEWHP" ]; then
-			perl -pi -e "s;(Standards-Version:.+);\$1\nHomepage: $NEWHP;" trunk/$p/debian/control
-			dch --release-heuristic=changelog --changelog trunk/$p/debian/changelog "Add missing Homepage field to source stanza in debian/control."
+			perl -pi -e "s;(Standards-Version:.+);\$1\nHomepage: $NEWHP;" $p/debian/control
+			dch --release-heuristic=changelog --changelog $p/debian/changelog "Add missing Homepage field to source stanza in debian/control."
 			CHANGED=1
 		fi
 	fi
@@ -90,22 +90,22 @@
 # work is done. svn diff? svn commit?
 if [ "$CHANGED" = "1" ]; then
 
-	read -p "Show svn diff trunk/ (y|N)? " DIFF
+	read -p "Show svn diff (y|N)? " DIFF
 	case $DIFF in
 		y|Y)
-			svn diff trunk/ | less
+			svn diff | less
 			;;
 		*)
 			;;
 	esac
 
         if [ -n "$UNCLEAN" ]; then
-            echo trunk was not clean at start. Please commit manually.
+            echo `pwd` was not clean at start. Please commit manually.
         else
             read -p "Commit (y|N)? " COMMIT
             case $COMMIT in
                 y|Y)
-                svn ci -m "Add missing XS-Vcs-(Svn|Browser)/Homepage field(s) to debian/control." trunk/
+                svn ci -m "Add missing XS-Vcs-(Svn|Browser)/Homepage field(s) to debian/control."
                 break
                 ;;
                 *)




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