aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2024-03-08 22:43:18 -0800
committerDan Fandrich <danf@mageia.org>2024-03-08 23:55:05 -0800
commitdcfd914210f70323bdb8c8820cc2eed8f83f4f1f (patch)
tree08dd439b48fab20efcad14c13c2b783b49524c97
parentde98902a85982351c7539672391de014252edde5 (diff)
downloadmgaadvisories-dcfd914210f70323bdb8c8820cc2eed8f83f4f1f.tar
mgaadvisories-dcfd914210f70323bdb8c8820cc2eed8f83f4f1f.tar.gz
mgaadvisories-dcfd914210f70323bdb8c8820cc2eed8f83f4f1f.tar.bz2
mgaadvisories-dcfd914210f70323bdb8c8820cc2eed8f83f4f1f.tar.xz
mgaadvisories-dcfd914210f70323bdb8c8820cc2eed8f83f4f1f.zip
Write JSON output files in mksite
-rw-r--r--NEWS1
-rw-r--r--lib/MGA/Advisories.pm2
2 files changed, 3 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8a16eb6..74404ba 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Version X
- template: change default CVE year to 2024
- use https: links where possible
- add 'showjson' command to output an advisory in OSV JSON format
+- have 'mksite' write JSON output files as well
Version 0.27
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index c8514fa..8ce3581 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -620,6 +620,7 @@ sub output_pages {
ENCODING => 'utf8',
INCLUDE_PATH => $config->{tmpl_dir},
OUTPUT_PATH => $config->{out_dir},
+ EVAL_PERL => 1,
);
foreach my $adv (keys %{$advdb->{advisories}}) {
my $vars = {
@@ -630,6 +631,7 @@ sub output_pages {
tools => \%tools,
};
process_template($template, 'advisory', $vars, $basename{ID}->($adv));
+ process_template($template, 'advisory', $vars, $basename{ID}->($adv), 'json');
}
foreach my $by (['rel', 'by_rel'], ['CVE', 'by_cve'], ['src', 'by_src']) {
foreach my $r (keys %{$advdb->{$by->[1]}}) {