r11872 - /scripts/qa/packagecheck

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sun Dec 30 19:32:11 UTC 2007


Author: gregoa-guest
Date: Sun Dec 30 19:32:11 2007
New Revision: 11872

URL: http://svn.debian.org/wsvn/?sc=1&rev=11872
Log:
add section to make rmdir /usr/{lib,share}/perl5 conditional

Modified:
    scripts/qa/packagecheck

Modified: scripts/qa/packagecheck
URL: http://svn.debian.org/wsvn/scripts/qa/packagecheck?rev=11872&op=diff
==============================================================================
--- scripts/qa/packagecheck (original)
+++ scripts/qa/packagecheck Sun Dec 30 19:32:11 2007
@@ -12,6 +12,8 @@
 #    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/
+# 6) rmdir /usr/{lib,share}/perl5 only if they exist
+#    in debian/rules
 #
 # To be run a directory above trunk/
 # (which name can be specified as the first argument)
@@ -41,6 +43,7 @@
   MSG_CONTROL_ADD=
   MSG_CONTROL_RM=
   MSG_WATCH=
+  MSG_RULES=
   
   # 1) check for and add missing Vcs-Svn field
 	if ! grep ^Vcs-Svn $TRUNK/$p/debian/control > /dev/null; then
@@ -120,14 +123,42 @@
 		fi
 	fi
 	
-	# 7) changelog
+	# 7) handle rmdir /usr/{share,lib}/perl5
+	if grep -m 1 "rmdir.*ignore-fail-on-non-empty" $TRUNK/$p/debian/rules | grep -v "\[ \! -d" > /dev/null ; then
+		ARCH=$(grep -m 1 -h "Architecture:" $TRUNK/$p/debian/control | awk '{print $2;}')
+		case $ARCH in
+			any)
+				DELDIR="/share/perl5"
+				;;
+			all)
+				DELDIR="/lib/perl5"
+				;;
+			*)
+				;;
+		esac
+		echo "$p: 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 \$1${DELDIR}}; print;} exit \$changed" $TRUNK/$p/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{-?find.+xargs.+rmdir.+}{[ ! -d \\\$(CURDIR)/debian/\\\$(shell dh_listpackages)/usr${DELDIR} ] || rmdir --ignore-fail-on-non-empty --parents \\\$(CURDIR)/debian/\\\$(shell dh_listpackages)/usr${DELDIR}}; print;} exit \$changed" $TRUNK/$p/debian/rules ; then
+			MSG_RULES="debian/rules: delete /usr${DELDIR} only if it exists." && \
+			CHANGED=1
+		fi
+	fi
+	
+	# 8) 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."
+		dch --release-heuristic=changelog --changelog $TRUNK/$p/debian/changelog "$MSG_CONTROL"
 	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"
+	if [ -n "$MSG_WATCH" ] ; then
+		dch --release-heuristic=changelog --changelog $TRUNK/$p/debian/changelog "$MSG_WATCH"
+	fi
+	if [ -n "$MSG_RULES" ] ; then
+		dch --release-heuristic=changelog --changelog $TRUNK/$p/debian/changelog "$MSG_RULES"
 	fi
 
 done
@@ -150,7 +181,7 @@
 		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
+				svn ci -m "[packagecheck] fixed Vcs-(Svn|Browser)/Homepage field(s) in debian/control and/or URL in debian/watch and/or rmdir /usr/{lib|share}/perl5 in debian/rules." $TRUNK
 				;;
 			*)
 				;;




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