Gentoo Archives: gentoo-portage-dev

From: Aaron Bauman <bman@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>, Pavel Sanda <ps@××××××××××.cz>
Subject: Re: [gentoo-portage-dev] [PATCH] glsa-check: add --reverse option (bug 235970)
Date: Sun, 01 Sep 2019 15:19:55
Message-Id: 20190901151949.GA638828@bubba.lan
In Reply to: [gentoo-portage-dev] [PATCH] glsa-check: add --reverse option (bug 235970) by Zac Medico
1 On Sat, Aug 31, 2019 at 09:41:55PM -0700, Zac Medico wrote:
2 > Add --reverse option which causes GLSAs to be listed in reverse order,
3 > so that the most recent GLSAs are listed earlier.
4 >
5 > Suggested-by: Pavel Sanda <ps@××××××××××.cz>
6 > Bug: https://bugs.gentoo.org/235970
7 > Signed-off-by: Zac Medico <zmedico@g.o>
8 > ---
9 > bin/glsa-check | 5 +++--
10 > 1 file changed, 3 insertions(+), 2 deletions(-)
11 >
12 > diff --git a/bin/glsa-check b/bin/glsa-check
13 > index 95ef16fde..6dbb7513c 100755
14 > --- a/bin/glsa-check
15 > +++ b/bin/glsa-check
16 > @@ -67,6 +67,8 @@ parser.add_argument("-e", "--emergelike", action="store_false", dest="least_chan
17 > help="Upgrade to latest version (not least-change)")
18 > parser.add_argument("-c", "--cve", action="store_true", dest="list_cve",
19 > help="Show CVE IDs in listing mode")
20 > +parser.add_argument("-r", "--reverse", action="store_true", dest="reverse",
21 > + help="List GLSAs in reverse order")
22 >
23 > options, params = parser.parse_known_args()
24 >
25 > @@ -162,8 +164,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
26 > fd2.write(green("[U]")+" means the system is not affected and\n")
27 > fd2.write(red("[N]")+" indicates that the system might be affected.\n\n")
28 >
29 > - myglsalist.sort()
30 > - for myid in myglsalist:
31 > + for myid in sorted(myglsalist, reverse=options.reverse):
32 > try:
33 > myglsa = Glsa(myid, portage.settings, vardb, portdb)
34 > except (GlsaTypeException, GlsaFormatException) as e:
35 > --
36 > 2.21.0
37 >
38 >
39
40 Applied and works great here on multiple combinations.
41
42 Acked-by: Aaron Bauman <bman@g.o>
43
44 --
45 Cheers,
46 Aaron

Attachments

File name MIME type
signature.asc application/pgp-signature