diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-06-12 21:47:18 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-06-12 21:47:18 +0000 |
commit | 9834ac78bd45c292bf940a08ad5205100b9a7a40 (patch) | |
tree | a3662e3ec9644bceda6ed1b9e97dbb4f2808a739 | |
parent | c9a20a66af94911ad1fe5bae9f9a15e0c4936a6b (diff) | |
download | mgaadvisories-9834ac78bd45c292bf940a08ad5205100b9a7a40.tar mgaadvisories-9834ac78bd45c292bf940a08ad5205100b9a7a40.tar.gz mgaadvisories-9834ac78bd45c292bf940a08ad5205100b9a7a40.tar.bz2 mgaadvisories-9834ac78bd45c292bf940a08ad5205100b9a7a40.tar.xz mgaadvisories-9834ac78bd45c292bf940a08ad5205100b9a7a40.zip |
Add advisories pages by CVE, release, source package
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | mkadvisories | 15 | ||||
-rw-r--r-- | tmpl/advisories.html | 12 | ||||
-rw-r--r-- | tmpl/advisories_table.html | 65 | ||||
-rw-r--r-- | tmpl/by_cve.html | 12 | ||||
-rw-r--r-- | tmpl/by_rel.html | 12 | ||||
-rw-r--r-- | tmpl/by_src.html | 12 | ||||
-rw-r--r-- | tmpl/index.html | 15 |
8 files changed, 131 insertions, 13 deletions
@@ -1,4 +1,5 @@ - add advisories html pages +- add advisories pages by CVE, release, source package Version 0.1 diff --git a/mkadvisories b/mkadvisories index 110a791..97a0072 100755 --- a/mkadvisories +++ b/mkadvisories @@ -22,7 +22,7 @@ my %basename = ( CVE => sub { $_[0] }, ID => sub { $_[0] }, rel => sub { $_[0] }, - pkg => sub { 'pkg_' . $_[0] }, + src => sub { 'src_' . $_[0] }, ); my %tools = ( @@ -110,6 +110,18 @@ sub output_pages { }; process_template($template, 'advisory', $vars, $basename{ID}->($adv)); } + foreach my $by (['rel', 'by_rel'], ['CVE', 'by_cve'], ['src', 'by_src']) { + foreach my $r (keys %{$advdb->{$by->[1]}}) { + my $vars = { + config => $config, + $by->[0] => $r, + advdb => $advdb, + basename => \%basename, + tools => \%tools, + }; + process_template($template, $by->[1], $vars, $basename{$by->[0]}->($r)); + } + } my $vars = { config => $config, advdb => $advdb, @@ -117,6 +129,7 @@ sub output_pages { tools => \%tools, }; process_template($template, 'index', $vars, 'index'); + process_template($template, 'advisories', $vars, 'advisories'); } sub send_adv_mail { diff --git a/tmpl/advisories.html b/tmpl/advisories.html new file mode 100644 index 0000000..513672a --- /dev/null +++ b/tmpl/advisories.html @@ -0,0 +1,12 @@ +[% USE date -%] +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Mageia Advisories</title> + </head> + <body> + <h1>Mageia Advisories</h1> + + [% INCLUDE advisories_table.html advlst = advdb.advisories.keys.sort.reverse %] + </body> +</html> diff --git a/tmpl/advisories_table.html b/tmpl/advisories_table.html new file mode 100644 index 0000000..6702ace --- /dev/null +++ b/tmpl/advisories_table.html @@ -0,0 +1,65 @@ + <table border='0'> + <tr> + <th> + Date + </th> + <th> + ID + </th> + <th> + Source Package(s) + </th> + <th> + Type + </th> + <th> + Affected release(s) + </th> + <th> + CVE + </th> + </tr> + + [% FOREACH adv IN advlst %] + <tr> + <td width='100'> + [% date.format(advdb.advisories.$adv.pubtime, format => '%Y-%m-%d', gmt => 1) %] + </td> + <td width='150'><a href="[% basename.ID(adv) %].html">[% adv %]</a></td> + <td> + [% SET sep = '' %] + [% SET pkgs = {} %] + [% FOREACH rel IN advdb.advisories.$adv.src.keys %] + [% FOREACH media IN advdb.advisories.$adv.src.$rel.keys %] + [% FOREACH srpm IN advdb.advisories.$adv.src.$rel.$media %] + [% SET srcname = tools.pkgname(srpm) %] + [% IF ! pkgs.$srcname %] + [% SET pkgs.$srcname = 1 %] + [% sep %] + [% SET sep = ', ' %] + <a href="[% basename.src(srcname) %].html">[% srcname %]</a> + [% END %] + [% END %] + [% END %] + [% END %] + </td> + <td>[% advdb.advisories.$adv.type %]</td> + <td> + [% SET sep = '' %] + [% FOREACH rel IN advdb.advisories.$adv.src.keys %] + [% sep %] + [% SET sep = ', ' %] + <a href="[% basename.rel(rel) %].html">[% rel %]</a> + [% END %] + </td> + <td> + [% SET sep = '' %] + [% FOREACH cve IN advdb.advisories.$adv.CVE %] + [% sep %] + [% SET sep = ', ' %] + <a href="[% basename.CVE(cve) %].html">[% cve %]</a> + [% END %] + </td> + </tr> + [% END %] + </table> diff --git a/tmpl/by_cve.html b/tmpl/by_cve.html new file mode 100644 index 0000000..788f19a --- /dev/null +++ b/tmpl/by_cve.html @@ -0,0 +1,12 @@ +[% USE date -%] +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>[% CVE %]</title> + </head> + <body> + <h1><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=[% CVE %]">[% CVE %]</a></h1> + + [% INCLUDE advisories_table.html advlst = advdb.by_cve.$CVE.sort.reverse %] + </body> +</html> diff --git a/tmpl/by_rel.html b/tmpl/by_rel.html new file mode 100644 index 0000000..f3729e3 --- /dev/null +++ b/tmpl/by_rel.html @@ -0,0 +1,12 @@ +[% USE date -%] +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Mageia [% rel %] Advisories</title> + </head> + <body> + <h1>Mageia [% rel %] Advisories</h1> + + [% INCLUDE advisories_table.html advlst = advdb.by_rel.$rel.sort.reverse %] + </body> +</html> diff --git a/tmpl/by_src.html b/tmpl/by_src.html new file mode 100644 index 0000000..a792c81 --- /dev/null +++ b/tmpl/by_src.html @@ -0,0 +1,12 @@ +[% USE date -%] +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Mageia advisories for package [% src %]</title> + </head> + <body> + <h1>Mageia advisories for package [% src %]</h1> + + [% INCLUDE advisories_table.html advlst = advdb.by_src.$src.sort.reverse %] + </body> +</html> diff --git a/tmpl/index.html b/tmpl/index.html index bb1691f..34dc474 100644 --- a/tmpl/index.html +++ b/tmpl/index.html @@ -7,9 +7,10 @@ <body> <h1>Mageia Advisories</h1> <ul> - [%- FOREACH adv IN advdb.advisories.keys.sort.reverse -%] - <li><a href="[% basename.ID(adv) %].html">[% adv %]</a>: [% advdb.advisories.$adv.subject %]</li> + [% FOREACH rel IN advdb.by_rel.keys.sort -%] + <li><a href="[% basename.rel(rel) %].html">Mageia [% rel %] advisories</a></li> [%- END -%] + <li><a href="advisories.html">All advisories</a></li> </ul> <h1>Older Advisories</h1> Older advisories are available on Mageia wiki : @@ -20,15 +21,5 @@ <h1>DB Dump</h1> A dump of all advisories is available as <a href="advisories.yaml">a yaml file</a>. - - <h1>Work in progress</h1> - This website is a work in progress. New versions should provide : - <ul> - <li>Advisories html pages</li> - <li>RSS feeds</li> - <li>Per CVE pages</li> - <li>Per distribution pages</li> - <li>Automatic packages move</li> - </ul> </body> </html> |