aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-06-17 14:31:51 +0000
committerNicolas Vigier <boklm@mageia.org>2013-06-17 14:31:51 +0000
commitafee969c4aa80f36cda9a3967e9c4c964867658e (patch)
treed319be10089bbdf718345bf3046af41037ca1ce6
parenta27af5aff4df03c1836201d7e045ef137454a6af (diff)
downloadmgaadvisories-afee969c4aa80f36cda9a3967e9c4c964867658e.tar
mgaadvisories-afee969c4aa80f36cda9a3967e9c4c964867658e.tar.gz
mgaadvisories-afee969c4aa80f36cda9a3967e9c4c964867658e.tar.bz2
mgaadvisories-afee969c4aa80f36cda9a3967e9c4c964867658e.tar.xz
mgaadvisories-afee969c4aa80f36cda9a3967e9c4c964867658e.zip
List unpublished advisories when mode is set to 'qa'
-rw-r--r--NEWS1
-rw-r--r--lib/MGA/Advisories.pm5
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 2807504..5be70b8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+- list unpublished advisories when mode is set to 'qa'
- add 'nextid' and 'publish' commands to assign an ID to an advisory file
Version 0.6
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index d321017..a69cf16 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -58,7 +58,10 @@ sub get_advisories_from_dir {
my %advisories;
foreach my $advfile (glob "$config->{advisories_dir}/*.adv") {
my $adv = LoadFile($advfile);
- next unless $adv->{ID};
+ if (!$adv->{ID}) {
+ next unless $config->{mode} eq 'qa';
+ $adv->{ID} = next_id('TODO', keys %advisories);
+ }
report_exit("Duplicate advisory $adv->{ID}") if $advisories{$adv->{ID}};
report_exit("Unknown type $adv->{type}") unless
$config->{advisory_types}{$adv->{type}};