aboutsummaryrefslogtreecommitdiffstats
path: root/mgaadv
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-06-17 20:48:45 +0000
committerNicolas Vigier <boklm@mageia.org>2013-06-17 20:48:45 +0000
commit472cd881bd9d799ef3680ed0c65a40ca2007ac2b (patch)
tree60e0bac5f90f920b8fedc7aae2205cb0f49e65de /mgaadv
parent7c4c1d3a5c991114d9d951cb550756fa314689f5 (diff)
downloadmgaadvisories-472cd881bd9d799ef3680ed0c65a40ca2007ac2b.tar
mgaadvisories-472cd881bd9d799ef3680ed0c65a40ca2007ac2b.tar.gz
mgaadvisories-472cd881bd9d799ef3680ed0c65a40ca2007ac2b.tar.bz2
mgaadvisories-472cd881bd9d799ef3680ed0c65a40ca2007ac2b.tar.xz
mgaadvisories-472cd881bd9d799ef3680ed0c65a40ca2007ac2b.zip
Add support for filters on list command
Possible filters are : - advisory type - distribution release - package name - CVE - media
Diffstat (limited to 'mgaadv')
-rwxr-xr-xmgaadv30
1 files changed, 26 insertions, 4 deletions
diff --git a/mgaadv b/mgaadv
index afbe8dd..e2ed080 100755
--- a/mgaadv
+++ b/mgaadv
@@ -21,9 +21,30 @@ END
run => \&listadv,
descr => 'List advisories',
usage => <<END,
-$0 list
+$0 list [filter...]
+
+Print the list of published advisories. Optionally you can filter the
+list with one or more filters. Possible filters are :
+- advisory type
+- distribution release
+- package name
+- CVE
+- media
+
+Examples :
+
+ list advisories for package wireshark :
+ \$ mgaadv list wireshark
+
+ list security advisories for package wireshark :
+ \$ mgaadv list security wireshark
+
+ list advisories for CVE CVE-2013-3560
+ \$ mgaadv list CVE-2013-3560
+
+ list advisories for Mageia 2 in media tainted :
+ \$ mgaadv list 2 tainted
-Print the list of published advisories
END
},
mksite => {
@@ -147,10 +168,11 @@ sub publish {
}
sub listadv {
- usageexit('usage', $_[0]) unless @_ == 1;
+ shift;
my %advdb;
$advdb{advisories} = MGA::Advisories::get_advisories();
- MGA::Advisories::listadv(\%advdb);
+ MGA::Advisories::sort_advisories(\%advdb) if @_;
+ MGA::Advisories::listadv(\%advdb, @_);
}
sub showadv {