aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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";
+ }
}
}
}