r8063 - /scripts/qa/packagecheck
hanska-guest at users.alioth.debian.org
hanska-guest at users.alioth.debian.org
Wed Oct 3 20:29:08 UTC 2007
Author: hanska-guest
Date: Wed Oct 3 20:29:08 2007
New Revision: 8063
URL: http://svn.debian.org/wsvn/?sc=1&rev=8063
Log:
Changed again
Modified:
scripts/qa/packagecheck
Modified: scripts/qa/packagecheck
URL: http://svn.debian.org/wsvn/scripts/qa/packagecheck?rev=8063&op=diff
==============================================================================
--- scripts/qa/packagecheck (original)
+++ scripts/qa/packagecheck Wed Oct 3 20:29:08 2007
@@ -7,22 +7,25 @@
# 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 into trunk/ (which might have any name now -- David Paleino)
+#
+# To be run a directory above trunk/
+# (which name can be specified as the first argument)
CHANGED=0
+TRUNK=${1:-trunk}
echo "Running svn up ..."
-svn up
+svn up $TRUNK
echo "Checking if `pwd` is clean ..."
-UNCLEAN=$(svn st |egrep -v '^\?')
+UNCLEAN=$(svn st $TRUNK |egrep -v '^\?')
if [ -n "$UNCLEAN" ]; then
echo "$UNCLEAN"
- echo WARNING: `pwd` is not clean
+ echo WARNING: $TRUNK is not clean
fi
echo "Grepping through packages ..."
-for p in $(svn ls); do
+for p in $(svn ls $TRUNK); do
# 0) reset variables
p=${p%/}
@@ -31,45 +34,45 @@
NEWHP=
# 1) check for and add missing XS-Vcs-Svn field
- if ! grep XS-Vcs-Svn $p/debian/control > /dev/null; then
+ if ! grep XS-Vcs-Svn $TRUNK/$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/;" $p/debian/control
- dch --release-heuristic=changelog --changelog $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/;" $TRUNK/$p/debian/control
+ dch --release-heuristic=changelog --changelog $TRUNK/$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 $p/debian/control > /dev/null; then
+ if ! grep XS-Vcs-Browser $TRUNK/$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/;" $p/debian/control
- dch --release-heuristic=changelog --changelog $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/;" $TRUNK/$p/debian/control
+ dch --release-heuristic=changelog --changelog $TRUNK/$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: " $p/debian/control | egrep -o "http.+")
+ OLDHP=$(egrep "^ Homepage: " $TRUNK/$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" < $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."
+ 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."
CHANGED=1
NEWHP=$OLDHP
fi
# 4) check for and add missing new Homepage to source stanza
- if ! egrep "^Homepage: " $p/debian/control > /dev/null; then
+ if ! egrep "^Homepage: " $TRUNK/$p/debian/control > /dev/null; then
echo "$p: trying to add missing Homepage field to source stanza"
# try to construct canonical URL
- 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)
+ 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)
fi
- 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)
+ 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)
fi
- 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)
+ 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)
fi
if [ -n "$PERLNAME" ]; then
if curl --silent http://search.cpan.org/dist/$PERLNAME/ grep '<title>.*</title>' | grep --silent $PERLNAME; then
@@ -80,8 +83,8 @@
# get NEWHP from somewhere else? debian/watch? debian/copyright?
if [ -n "$NEWHP" ]; then
- 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."
+ 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."
CHANGED=1
fi
fi
@@ -90,22 +93,22 @@
# work is done. svn diff? svn commit?
if [ "$CHANGED" = "1" ]; then
- read -p "Show svn diff (y|N)? " DIFF
+ read -p "Show svn diff $TRUNK (y|N)? " DIFF
case $DIFF in
y|Y)
- svn diff | less
+ svn diff $TRUNK | less
;;
*)
;;
esac
if [ -n "$UNCLEAN" ]; then
- echo `pwd` was not clean at start. Please commit manually.
+ 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 XS-Vcs-(Svn|Browser)/Homepage field(s) to debian/control."
+ svn ci -m "Add missing XS-Vcs-(Svn|Browser)/Homepage field(s) to debian/control." $TRUNK
break
;;
*)
More information about the Pkg-perl-cvs-commits
mailing list