aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-08-31 21:36:05 -0700
committerZac Medico <zmedico@gentoo.org>2019-09-01 11:29:10 -0700
commita17c3627190aa2e9594220b22f9f1acf46c81d2f (patch)
tree336fb56dff7be594a03f2960d9b8c2fad8ed4f9a
parentglsa-check: fix truncated CVE ids in listmode (bug 692134) (diff)
downloadportage-a17c3627190aa2e9594220b22f9f1acf46c81d2f.tar.gz
portage-a17c3627190aa2e9594220b22f9f1acf46c81d2f.tar.bz2
portage-a17c3627190aa2e9594220b22f9f1acf46c81d2f.zip
glsa-check: add --reverse option (bug 235970)
Add --reverse option which causes GLSAs to be listed in reverse order, so that the most recent GLSAs are listed earlier. Suggested-by: Pavel Sanda <ps@twin.jikos.cz> Bug: https://bugs.gentoo.org/235970 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rwxr-xr-xbin/glsa-check5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/glsa-check b/bin/glsa-check
index 6bb2ee21e..eff01cf31 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -68,6 +68,8 @@ parser.add_argument("-e", "--emergelike", action="store_false", dest="least_chan
help="Upgrade to latest version (not least-change)")
parser.add_argument("-c", "--cve", action="store_true", dest="list_cve",
help="Show CVE IDs in listing mode")
+parser.add_argument("-r", "--reverse", action="store_true", dest="reverse",
+ help="List GLSAs in reverse order")
options, params = parser.parse_known_args()
@@ -163,8 +165,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
fd2.write(green("[U]")+" means the system is not affected and\n")
fd2.write(red("[N]")+" indicates that the system might be affected.\n\n")
- myglsalist.sort()
- for myid in myglsalist:
+ for myid in sorted(myglsalist, reverse=options.reverse):
try:
myglsa = Glsa(myid, portage.settings, vardb, portdb)
except (GlsaTypeException, GlsaFormatException) as e: