r11444 - /scripts/qa/packagecheck

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Thu Dec 20 17:38:52 UTC 2007


Author: gregoa-guest
Date: Thu Dec 20 17:38:51 2007
New Revision: 11444

URL: http://svn.debian.org/wsvn/?sc=1&rev=11444
Log:
packagecheck: add new check: change URL in debian/watch to use 'http://search.cpan.org/dist/Module-Name/ ...'

Modified:
    scripts/qa/packagecheck

Modified: scripts/qa/packagecheck
URL: http://svn.debian.org/wsvn/scripts/qa/packagecheck?rev=11444&op=diff
==============================================================================
--- scripts/qa/packagecheck (original)
+++ scripts/qa/packagecheck Thu Dec 20 17:38:51 2007
@@ -9,7 +9,9 @@
 # 2) Checks for Homepage: field
 # 3) Removes pseudo-field Homepage (description)
 # 4) Removes XS-Vcs-(Svn|Browser) fields
-# in all debian/control files in trunk/
+#    in all debian/control files in trunk/
+# 5) Change URLs to http://search.cpan.org/dist/Mod-Ule/
+#    in all debian/watch files in trunk/
 #
 # To be run a directory above trunk/
 # (which name can be specified as the first argument)
@@ -35,15 +37,16 @@
   OLDHP=
   PERLNAME=
   NEWHP=
-  MSG=
-  MSGADD=
-  MSGRM=
+  MSG_CONTROL=
+  MSG_CONTROL_ADD=
+  MSG_CONTROL_RM=
+  MSG_WATCH=
   
   # 1) check for and add missing Vcs-Svn field
 	if ! grep ^Vcs-Svn $TRUNK/$p/debian/control > /dev/null; then
 		echo "$p: adding missing Vcs-Svn field"
 		perl -pi -e "s;(Standards-Version:.+);\$1\nVcs-Svn: svn://svn.debian.org/pkg-perl/trunk/$p/;" $TRUNK/$p/debian/control
-		MSGADD="Vcs-Svn field (source stanza)"
+		MSG_CONTROL_ADD="Vcs-Svn field (source stanza)"
 		CHANGED=1
 	fi
 
@@ -51,7 +54,7 @@
 	if ! grep ^Vcs-Browser $TRUNK/$p/debian/control > /dev/null; then
 		echo "$p: adding missing Vcs-Browser field"
 		perl -pi -e "s;(^Vcs-Svn:.+);\$1\nVcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/$p/;" $TRUNK/$p/debian/control
-		MSGADD="${MSGADD:+$MSGADD; }Vcs-Browser field (source stanza)"
+		MSG_CONTROL_ADD="${MSG_CONTROL_ADD:+$MSG_CONTROL_ADD; }Vcs-Browser field (source stanza)"
 		CHANGED=1
 	fi
 
@@ -61,7 +64,7 @@
 		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
-		MSGRM="Homepage pseudo-field (Description)"
+		MSG_CONTROL_RM="Homepage pseudo-field (Description)"
 		CHANGED=1
 		NEWHP=$OLDHP
 	fi
@@ -70,7 +73,7 @@
 	if grep ^XS-Vcs- $TRUNK/$p/debian/control > /dev/null; then
 		echo "$p: removing old XS-Vcs-* fields"
 		sed -i -e '/^XS-Vcs-/ d' $TRUNK/$p/debian/control
-		MSGRM="${MSGRM:+$MSGRM; }XS-Vcs-Svn fields (source stanza)"
+		MSG_CONTROL_RM="${MSG_CONTROL_RM:+$MSG_CONTROL_RM; }XS-Vcs-Svn fields (source stanza)"
 		CHANGED=1
 	fi
 
@@ -102,17 +105,27 @@
 		
 		if [ -n "$NEWHP" ]; then
 			perl -pi -e "s;(Standards-Version:.+);\$1\nHomepage: $NEWHP;" $TRUNK/$p/debian/control
-			MSGADD="${MSGADD:+$MSGADD; }Homepage field (source stanza)"
+			MSG_CONTROL_ADD="${MSG_CONTROL_ADD:+$MSG_CONTROL_ADD; }Homepage field (source stanza)"
 			CHANGED=1
 		fi
 	fi
 
-	# 6) changelog
-	if [ -n "$MSGADD" -o -n "$MSGRM" ] ; then
-		MSG="debian/control:"
-		[ -n "$MSGADD" ] && MSG="$MSG Added: $MSGADD."
-		[ -n "$MSGRM" ] && MSG="$MSG Removed: $MSGRM."
-		dch --release-heuristic=changelog --changelog $TRUNK/$p/debian/changelog "$MSG"
+	# 6) watchfile
+	if [ -e $TRUNK/$p/debian/watch ] && ! grep search\.cpan\.org/dist/ $TRUNK/$p/debian/watch >/dev/null; then
+		echo "$p: changing URL in debian/watch"
+		perl -pi -e "s;^(?:ht|f)tp://.+cpan.+/(.+)-(.+)$;http://search.cpan.org/dist/\$1/ .*/\$1-\$2;" $TRUNK/$p/debian/watch
+		MSG_WATCH="debian/watch: use dist-based URL."
+		CHANGED=1
+	fi
+	
+	# 7) changelog
+	if [ -n "$MSG_CONTROL_ADD" -o -n "$MSG_CONTROL_RM" ] ; then
+		MSG_CONTROL="debian/control:"
+		[ -n "$MSG_CONTROL_ADD" ] && MSG_CONTROL="$MSG_CONTROL Added: $MSG_CONTROL_ADD."
+		[ -n "$MSG_CONTROL_RM" ] && MSG_CONTROL="$MSG_CONTROL Removed: $MSG_CONTROL_RM."
+	fi
+	if [ -n "$MSG_CONTROL" -o -n "$MSG_WATCH" ] ; then
+		dch --release-heuristic=changelog --changelog $TRUNK/$p/debian/changelog "${MSG_CONTROL:+$MSG_CONTROL }$MSG_WATCH"
 	fi
 
 done
@@ -129,19 +142,18 @@
 			;;
 	esac
 
-        if [ -n "$UNCLEAN" ]; then
-            echo $TRUNK 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 Vcs-(Svn|Browser)/Homepage field(s) to debian/control." $TRUNK
-                break
-                ;;
-                *)
-                ;;
-            esac
-        fi
+	if [ -n "$UNCLEAN" ]; then
+		echo $TRUNK was not clean at start. Please commit manually.
+	else
+		read -p "Commit $TRUNK (y|N)? " COMMIT
+		case $COMMIT in
+			y|Y)
+				svn ci -m "[packagecheck] fixed Vcs-(Svn|Browser)/Homepage field(s) in debian/control and/or URL in debian/watch." $TRUNK
+				;;
+			*)
+				;;
+		esac
+	fi
 
 else
 	echo "Nothing changed."




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