aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MGA/Advisories.pm
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-06-17 14:31:44 +0000
committerNicolas Vigier <boklm@mageia.org>2013-06-17 14:31:44 +0000
commitd0d24cf9ec92d687e771c5b4061bb61ae5d31720 (patch)
treeccf950a0b26bf33bc5b796024217c6a3af64cd18 /lib/MGA/Advisories.pm
parentadb46fcb63bced2025c302d4ee4b44be8b23c592 (diff)
downloadmgaadvisories-d0d24cf9ec92d687e771c5b4061bb61ae5d31720.tar
mgaadvisories-d0d24cf9ec92d687e771c5b4061bb61ae5d31720.tar.gz
mgaadvisories-d0d24cf9ec92d687e771c5b4061bb61ae5d31720.tar.bz2
mgaadvisories-d0d24cf9ec92d687e771c5b4061bb61ae5d31720.tar.xz
mgaadvisories-d0d24cf9ec92d687e771c5b4061bb61ae5d31720.zip
Check type when assigning new ID
Diffstat (limited to 'lib/MGA/Advisories.pm')
-rw-r--r--lib/MGA/Advisories.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index fed9caa..cdba96f 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -84,8 +84,12 @@ sub assign_id {
print STDERR "$bugnum already has an ID assigned: $adv->{ID}\n";
return;
}
- $adv->{ID} = next_id($config->{advisory_types}{$adv->{type}}{prefix},
- keys %{get_advisories_from_dir()});
+ my $type = $config->{advisory_types}{$adv->{type}}{prefix};
+ if (!$type) {
+ print STDERR "Unknow type $adv->{type}\n";
+ return;
+ }
+ $adv->{ID} = next_id($type, keys %{get_advisories_from_dir()});
open(my $fh, '>>', $advfile) or die "Error opening $advfile";
print $fh "ID: $adv->{ID}\n";
close $fh;