SVN devscripts commit: r542 - in trunk: debian scripts

Adam D. Barratt adam-guest at alioth.debian.org
Tue Feb 27 15:26:12 CET 2007


Author: adam-guest
Date: 2007-02-27 15:26:11 +0100 (Tue, 27 Feb 2007)
New Revision: 542

Modified:
   trunk/debian/changelog
   trunk/scripts/tagpending.sh
Log:
tagpending: support marking wnpp bugs as pending (Closes: #398178)



Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-02-26 16:41:50 UTC (rev 541)
+++ trunk/debian/changelog	2007-02-27 14:26:11 UTC (rev 542)
@@ -45,7 +45,7 @@
     (Closes: #382884)
   * tagpending: factorized some code for delivering info to the user
   * tagpending: added an extra check to ensure that bugs to be tagged belong
-    to the current package, also avoids tagging of wnpp bugs (Closes: #398178)
+    to the current package
   * uscan: added --force-download to force download when changelog is in sync
     with upstream version, based on a patch from Ian Wienand (Closes: #364116)
 
@@ -53,8 +53,9 @@
   * Joining the team
   * tagpending: modify bug list display code to indicate whether --noact was
     used
+  * tagpending: support marking wnpp bugs as pending (Closes: #398178)
 
- -- Adam D. Barratt <debian-bts at adam-barratt.org.uk>  Mon, 26 Feb 2007 15:13:09 +0000
+ -- Adam D. Barratt <debian-bts at adam-barratt.org.uk>  Mon, 26 Feb 2007 19:03:06 +0000
 
 devscripts (2.9.27) unstable; urgency=low
 

Modified: trunk/scripts/tagpending.sh
===================================================================
--- trunk/scripts/tagpending.sh	2007-02-26 16:41:50 UTC (rev 541)
+++ trunk/scripts/tagpending.sh	2007-02-27 14:26:11 UTC (rev 542)
@@ -55,6 +55,8 @@
 CONFIRM=0
 
 BTS_BASE_URL="http://bugs.debian.org/cgi-bin/pkgreport.cgi"
+TAGS="<h3>Tags:"
+WNPP_MATCH="Package: <a href=\"pkgreport.cgi?pkg=wnpp\">wnpp<\/a>;"
 
 while [ -n "$1" ]; do
   case "$1" in
@@ -111,6 +113,7 @@
 
 # Now remove the ones tagged in the BTS but no longer in the changelog.
 to_be_tagged=""
+wnpp_to_be_tagged=""
 for bug in $to_be_checked; do
   if [ "$VERBOSE" = "1" ]; then
   	echo -n "Checking bug #$bug: "
@@ -122,11 +125,27 @@
       fi
       to_be_tagged="$to_be_tagged $bug"
     else
-      msg="does not belong to this package (check bug no. or force)"
-      if [ "$VERBOSE" = "1" ]; then
-	echo "$msg"
+      wnpp_tags=$( (wget -q -O- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=$bug; \
+        echo $TAGS) | sed -ne "/$WNPP_MATCH/,/^$TAGS/ {/^$TAGS/p}" )
+
+      if [ -n "$wnpp_tags" ]; then
+        if ! echo "$wnpp_tags" | grep -q "pending"; then
+          if [ "$VERBOSE" = "1" ]; then
+            echo "wnpp needs tag"
+          fi
+          wnpp_to_be_tagged="$wnpp_to_be_tagged $bug"
+        else
+          if [ "$VERBOSE" = "1" ]; then
+            echo "wnpp already marked pending"
+          fi
+        fi
       else
-	echo "Warning: #$bug $msg."
+        msg="does not belong to this package (check bug no. or force)"
+        if [ "$VERBOSE" = "1" ]; then
+	  echo "$msg"
+        else
+	  echo "Warning: #$bug $msg."
+        fi
       fi
     fi
   else
@@ -136,7 +155,7 @@
   fi
 done
 
-if [ -z "$to_be_tagged" ]; then
+if [ -z "$to_be_tagged" ] && [ -z "$wnpp_to_be_tagged" ]; then
   if [ "$SILENT" = 0 -o "$DRY" = 1 ]; then
     echo "tagpending info: Nothing to do, exiting."
   fi
@@ -147,6 +166,15 @@
 src_packages=$(awk '/Package: / { print $2 } /Source: / { print $2 }' debian/control | sort | uniq)
 
 bugs_info() {
+  if [ "$1" = "wnpp" ]; then
+    bugs=$wnpp_to_be_tagged
+    if [ -z "$bugs" ]; then
+      return
+    fi
+  else
+    bugs=$to_be_tagged
+  fi
+
   msg="tagpending info: "
 
   if [ "$DRY" = 1 ]; then
@@ -155,14 +183,20 @@
     msg="$msg tagging"
   fi
 
-  msg="$msg these bugs pending"
+  msg="$msg these"
 
-  if [ "$CONFIRM" = 1 ]; then
+  if [ "$1" = "wnpp" ]; then
+    msg="$msg wnpp"
+  fi
+
+  msg="$msg bugs pending"
+
+  if [ "$CONFIRM" = 1 ] && [ "$1" != "wnpp" ]; then
     msg="$msg and confirmed"
   fi
   msg="$msg:"
 
-  for bug in $to_be_tagged; do
+  for bug in $bugs; do
     msg="$msg $bug"
   done
   echo $msg | fold -w 78 -s
@@ -170,23 +204,38 @@
 
 if [ "$DRY" = 1 ]; then
   bugs_info
+  bugs_info wnpp
 
   exit 0
 else
   if [ "$SILENT" = 0 ]; then
     bugs_info
+    bugs_info wnpp
   fi
 
-  BTS_ARGS="package $src_packages"
+  if [ -n "$to_be_tagged" ]; then
+    BTS_ARGS="package $src_packages"
 
-  for bug in $to_be_tagged; do
-    BTS_ARGS="$BTS_ARGS . tag $bug + pending "
+    for bug in $to_be_tagged; do
+      BTS_ARGS="$BTS_ARGS . tag $bug + pending"
 
-    if [ "$CONFIRM" = 1 ]; then
-      BTS_ARGS="$BTS_ARGS confirmed"
+      if [ "$CONFIRM" = 1 ]; then
+        BTS_ARGS="$BTS_ARGS confirmed"
+      fi
+    done
+  fi
+
+  if [ -n "$wnpp_to_be_tagged" ]; then
+    if [ -n "$BTS_ARGS" ]; then
+      BTS_ARGS="$BTS_ARGS ."
     fi
-  done
+    BTS_ARGS="$BTS_ARGS package wnpp"
 
+    for bug in $wnpp_to_be_tagged; do
+      BTS_ARGS="$BTS_ARGS . tag $bug + pending"
+    done
+  fi
+
   eval bts ${BTS_ARGS}
 fi
 




More information about the Devscripts-devel mailing list