SVN devscripts commit: r532 - in trunk: debian scripts

Stefano Zacchiroli zack at alioth.debian.org
Sat Feb 24 13:08:08 CET 2007


Author: zack
Date: 2007-02-24 13:08:08 +0100 (Sat, 24 Feb 2007)
New Revision: 532

Modified:
   trunk/debian/changelog
   trunk/scripts/mass-bug.pl
Log:
added --severity flag to mass-bug

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-02-24 11:52:06 UTC (rev 531)
+++ trunk/debian/changelog	2007-02-24 12:08:08 UTC (rev 532)
@@ -33,10 +33,14 @@
   * dd-list: enable (-b cmdline flag) output of binary package names, patch
     from Frank Küster (Closes: #403207)
   * tagpending: enable (-c cmdline flag) tagging bugs as confirmed in addition
-    to tagging them as pending, patch from Adam D. Barratt (Closes: #382884)
+    to tagging them as pending, based on a patch from Adam D. Barratt
+    (Closes: #382884)
   * tagpending: factorized some code for delivering info to the user
+  * mass-bug: enable (--severity cmdline flag) the specification of the
+    severity of the reported bugs, based on a patch from Adam D. Barratt
+    (Closes: #386124)
 
- -- Stefano Zacchiroli <zack at debian.org>  Sat, 24 Feb 2007 12:50:52 +0100
+ -- Stefano Zacchiroli <zack at debian.org>  Sat, 24 Feb 2007 13:02:21 +0100
 
 devscripts (2.9.27) unstable; urgency=low
 

Modified: trunk/scripts/mass-bug.pl
===================================================================
--- trunk/scripts/mass-bug.pl	2007-02-24 11:52:06 UTC (rev 531)
+++ trunk/scripts/mass-bug.pl	2007-02-24 12:08:08 UTC (rev 532)
@@ -57,6 +57,11 @@
 
 =over 4
 
+=item --severity=(wishlist|minor|normal|important|serious|grave|critical)
+
+Specify the severity with which bugs should be filed. Default
+is 'normal'.
+
 =item --display
 
 Fill out the templates for each package and display them all for
@@ -143,6 +148,9 @@
    --subject="bug subject"
                           Text for email subject line (will be prefixed
                           with "package: ")
+   --severity=(wishlist|minor|normal|important|serious|grave|critical)
+			  Specify the severity of the bugs to be filed
+                          (default "normal")
    --sendmail=cmd         Sendmail command to use (default /usr/sbin/sendmail)
    --no-conf, --noconf    Don\'t read devscripts config files;
                           must be the first option given
@@ -234,6 +242,7 @@
 sub gen_bug {
     my $template_text=shift;
     my $package=shift;
+    my $severity=shift;
 
     $template_text=~s/#PACKAGE#/$package/g;
     if ($template_text =~ /\A(.*?)(^-- $.*)/m) { # there's a sig involved
@@ -242,7 +251,7 @@
     } else {
 	$template_text=fill("", "", $template_text);
     }
-    return "Package: $package\n\n$template_text";
+    return "Package: $package\nSeverity: $severity\n\n$template_text";
 }
 		
 sub div {
@@ -304,11 +313,13 @@
 
 my $mode="display";
 my $subject;
+my $severity="normal";
 my $opt_sendmail;
 if (! GetOptions(
 		 "display" => sub { $mode="display" },
 		 "send" => sub { $mode="send" },
 		 "subject=s" => \$subject,
+		 "severity=s" => \$severity,
 		 "sendmail=s" => \$opt_sendmail,
 		 "help" => sub { usage(); exit 0; },
 		 "version" => sub { version(); exit 0; },
@@ -321,6 +332,11 @@
     usageerror();
 }
 
+unless ($severity =~ /^(wishlist|minor|normal|important|serious|grave|critical)$/) {
+    print STDERR "$progname: Severity must be one of wishlist, minor, normal, important, serious, grave or critical.\n";
+    usageerror();
+}
+
 if (@ARGV != 2) {
     usageerror();
 }
@@ -373,7 +389,7 @@
     print "To: $submission_email\n";
     print "Subject: ".gen_subject($subject, $package)."\n";
     print "\n";
-    print gen_bug($template_text, $package)."\n";
+    print gen_bug($template_text, $package, $severity)."\n";
 }
 
 if ($mode eq 'display') {
@@ -405,7 +421,7 @@
     foreach my $package (@packages) {
 	print "Sending bug for $package ...\n";
 	mailbts(gen_subject($subject, $package),
-		gen_bug($template_text, $package),
+		gen_bug($template_text, $package, $severity),
 		$submission_email, $from);
     }
     print "All bugs sent.\n";




More information about the Devscripts-devel mailing list