aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/MGA/Advisories.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index cda9528..ec91efa 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -52,7 +52,7 @@ sub save_status {
DumpFile($statusfile, $advdb->{advisories}{$adv}{status});
}
-sub get_advisories {
+sub get_advisories_from_dir {
my %advisories;
foreach my $advfile (glob "$config->{advisories_dir}/*.adv") {
my $adv = LoadFile($advfile);
@@ -65,6 +65,16 @@ sub get_advisories {
return \%advisories;
}
+sub get_advisories_from_dump {
+ return LoadFile($_[0] || $config->{advdv_dumpfile}
+ || $ENV{HOME} . '/.mga-advisories/advisories.yaml');
+}
+
+sub get_advisories {
+ return $config->{mode} eq 'dump' ? get_advisories_from_dump
+ : get_advisories_from_dir;
+}
+
sub publish_advisories {
my ($advdb) = @_;
foreach my $adv (keys %{$advdb->{advisories}}) {