* [gentoo-portage-dev] [PATCH] glsa-check: add --reverse option (bug 235970)
@ 2019-09-01 4:41 Zac Medico
2019-09-01 15:19 ` Aaron Bauman
0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2019-09-01 4:41 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Zac Medico, Pavel Sanda
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>
---
bin/glsa-check | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/bin/glsa-check b/bin/glsa-check
index 95ef16fde..6dbb7513c 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -67,6 +67,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()
@@ -162,8 +164,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:
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] glsa-check: add --reverse option (bug 235970)
2019-09-01 4:41 [gentoo-portage-dev] [PATCH] glsa-check: add --reverse option (bug 235970) Zac Medico
@ 2019-09-01 15:19 ` Aaron Bauman
0 siblings, 0 replies; 2+ messages in thread
From: Aaron Bauman @ 2019-09-01 15:19 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Zac Medico, Pavel Sanda
[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]
On Sat, Aug 31, 2019 at 09:41:55PM -0700, Zac Medico wrote:
> 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>
> ---
> bin/glsa-check | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/bin/glsa-check b/bin/glsa-check
> index 95ef16fde..6dbb7513c 100755
> --- a/bin/glsa-check
> +++ b/bin/glsa-check
> @@ -67,6 +67,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()
>
> @@ -162,8 +164,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:
> --
> 2.21.0
>
>
Applied and works great here on multiple combinations.
Acked-by: Aaron Bauman <bman@gentoo.org>
--
Cheers,
Aaron
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-01 15:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-01 4:41 [gentoo-portage-dev] [PATCH] glsa-check: add --reverse option (bug 235970) Zac Medico
2019-09-01 15:19 ` Aaron Bauman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox