aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-08-03 18:12:25 +0100
committerColin Guthrie <colin@mageia.org>2014-08-03 19:12:59 +0100
commit84f3eaf41c30126ef87506f56ef9c1e5335d4864 (patch)
treec70e91e6ae679449d1bf22d98798513f34935a92
parent4a777c9242fc5e86ee2b97e5cd4aaf6899cac7ac (diff)
downloadmgaadvisories-84f3eaf41c30126ef87506f56ef9c1e5335d4864.tar
mgaadvisories-84f3eaf41c30126ef87506f56ef9c1e5335d4864.tar.gz
mgaadvisories-84f3eaf41c30126ef87506f56ef9c1e5335d4864.tar.bz2
mgaadvisories-84f3eaf41c30126ef87506f56ef9c1e5335d4864.tar.xz
mgaadvisories-84f3eaf41c30126ef87506f56ef9c1e5335d4864.zip
Fix perl warning when invalid SRPM name is found.
-rw-r--r--lib/MGA/Advisories.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index 4343d47..48038af 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -174,11 +174,14 @@ sub sort_advisories {
push @{$advdb->{by_rel}{$rel}}, $adv;
foreach my $media (keys %{$advdb->{advisories}{$adv}{src}{$rel}}) {
push @{$advdb->{by_media}{$media}}, $adv;
- my %pkgs;
foreach my $srpm (@{$advdb->{advisories}{$adv}{src}{$rel}{$media}}) {
my $pkgname = $tools{pkgname}->($srpm);
- push @{$advdb->{by_src}{$pkgname}}, $adv
- unless grep { $_ eq $adv } @{$advdb->{by_src}{$pkgname}};
+ if ($pkgname) {
+ push @{$advdb->{by_src}{$pkgname}}, $adv
+ unless grep { $_ eq $adv } @{$advdb->{by_src}{$pkgname}};
+ } else {
+ print STDERR "Warning: Invalid SRPM '$srpm' for advisory '$adv'\n";
+ }
}
}
}