tags 386124 + patch
thanks

Hi,

On Tue, 2006-09-05 at 14:56 +0200, martin f krafft wrote:
> Package: devscripts
> Version: 2.9.21
> Severity: wishlist
> File: /usr/bin/mass-bug
> 
> subject says it all.

As does the attachment. :-)

Regards,

Adam
--- devscripts-2.9.27.orig/mass-bug.pl	2006-11-08 18:41:44.000000000 +0000
+++ devscripts-2.9.27/mass-bug.pl	2007-02-20 23:07:37.000000000 +0000
@@ -57,6 +57,11 @@
 
 =over 4
 
+=item --severity
+
+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,8 @@
    --subject="bug subject"
                           Text for email subject line (will be prefixed
                           with "package: ")
+   --severity             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 +241,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 +250,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 +312,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 +331,11 @@
     usageerror();
 }
 
+unless ($severity =~ /^(wishlist|minor|normal|important|serious|grave|critical)$/) {
+    print STDERR "$progname: Severity must be one of minor, normal, important, serious, grave or critical.\n";
+    usageerror();
+}
+
 if (@ARGV != 2) {
     usageerror();
 }
@@ -373,7 +388,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 +420,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";

Reply via email to