aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--lib/MGA/Advisories.pm3
-rwxr-xr-xmgaadv12
-rw-r--r--tmpl/newadvisory.adv6
4 files changed, 14 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index f1055d3..a6f6ceb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- add a [name] argument to mgaadv new to prefill package name
+- prefill subject in new advisories
+
Version 0.20
- print out bug link when assigning IDs
@@ -102,4 +105,3 @@ Version 0.2
Version 0.1
- first version
-
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index cd56b56..d03a632 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -728,7 +728,7 @@ sub dumpdb {
}
sub newadv {
- my ($type, $bugnum) = @_;
+ my ($type, $bugnum, $name) = @_;
my $file = $config->{advisories_dir} . '/' . $bugnum . '.adv';
if (-f $file) {
print STDERR "File $file already exists\n";
@@ -742,6 +742,7 @@ sub newadv {
my $vars = {
type => $type,
bugnum => $bugnum,
+ name => $name,
};
process_template($template, 'newadvisory', $vars, $bugnum, 'adv');
return $file;
diff --git a/mgaadv b/mgaadv
index 1840c2d..ca519b0 100755
--- a/mgaadv
+++ b/mgaadv
@@ -69,10 +69,10 @@ END
run => \&newadv,
descr => 'Create a new advisory file',
usage => <<END,
-$0 new [type] [bugnum]
+$0 new [type] [bugnum] [name]
-Create a new advisory file. [type] should be security or bugfix and
-[bugnum] is the bugzilla bug number.
+Create a new advisory file. [type] should be security or bugfix,
+[bugnum] is the bugzilla bug number and [name] is the package name.
END
},
nextid => {
@@ -173,9 +173,9 @@ sub process {
sub editor { $ENV{EDITOR} || $ENV{VISUAL} || '/usr/bin/editor' }
sub newadv {
- usageexit('usage', $_[0]) unless @_ == 3;
- my ($new, $type, $bugnum) = @_;
- my $file = MGA::Advisories::newadv($type, $bugnum);
+ usageexit('usage', $_[0]) unless @_ == 4;
+ my ($new, $type, $bugnum, $name) = @_;
+ my $file = MGA::Advisories::newadv($type, $bugnum, $name);
if ($file) {
system(editor, $file);
}
diff --git a/tmpl/newadvisory.adv b/tmpl/newadvisory.adv
index 4f30636..6efc125 100644
--- a/tmpl/newadvisory.adv
+++ b/tmpl/newadvisory.adv
@@ -1,15 +1,15 @@
type: [% type %]
[% IF type == 'security' -%]
-subject: Updated [package] package fixes security vulnerability
+subject: Updated [% name %] package fixes security vulnerability
CVE:
- CVE-2014-XXXX
[% ELSE -%]
-subject: Updated [package] package fixes [something]
+subject: Updated [% name %] package fixes [something]
[% END -%]
src:
4:
core:
- - something-1.0-1.mga4
+ - [% name %]-1.0-1.mga4
description: |
Advisory text to describe the update.
Wrap lines at ~75 chars.