public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088)
@ 2019-08-30 23:03 Zac Medico
  2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 1/3] glsa-check: Fix traceback with glsa-check -f (Bug 275105) Zac Medico
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Zac Medico @ 2019-08-30 23:03 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

Bug: https://bugs.gentoo.org/693088

Zac Medico (3):
  glsa-check: Fix traceback with glsa-check -f (Bug 275105)
  glsa-check: Make --pretend output nicer
  glsa-check: Remove 'new' target from glsa-list

 bin/glsa-check | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

-- 
2.21.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-portage-dev] [PATCH 1/3] glsa-check: Fix traceback with glsa-check -f (Bug 275105)
  2019-08-30 23:03 [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088) Zac Medico
@ 2019-08-30 23:03 ` Zac Medico
  2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 2/3] glsa-check: Make --pretend output nicer Zac Medico
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Zac Medico @ 2019-08-30 23:03 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

This patch is a forward port of the following commit:

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=232d69fa230abb490e0b0f8eef550f28745be6a3

commit 232d69fa230abb490e0b0f8eef550f28745be6a3
Author:     fuzzyray <fuzzyray@gentoo.org>
AuthorDate: 2009-06-22 20:45:49 +0000
Commit:     fuzzyray <fuzzyray@gentoo.org>
CommitDate: 2009-06-22 20:45:49 +0000

    Fix traceback with glsa-check -f (Bug 275105)

    svn path=/trunk/gentoolkit/; revision=665

Bug: https://bugs.gentoo.org/693088
Signed-off-by: Zac Medico <zmedico@gentoo.org>
---
 bin/glsa-check | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index f6c744d84..3502812d9 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -248,8 +248,8 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 						exitcode >>= 8
 					if exitcode:
 						sys.exit(exitcode)
-			if len(mergelist):
-				sys.stdout.write("\n")
+				if len(mergelist):
+					sys.stdout.write("\n")
 		elif mode == "pretend":
 			if not quiet:
 				sys.stdout.write("Checking GLSA "+myid+"\n")
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-portage-dev] [PATCH 2/3] glsa-check: Make --pretend output nicer
  2019-08-30 23:03 [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088) Zac Medico
  2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 1/3] glsa-check: Fix traceback with glsa-check -f (Bug 275105) Zac Medico
@ 2019-08-30 23:03 ` Zac Medico
  2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 3/3] glsa-check: Remove 'new' target from glsa-list Zac Medico
  2019-08-31  2:34 ` [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088) Aaron Bauman
  3 siblings, 0 replies; 5+ messages in thread
From: Zac Medico @ 2019-08-30 23:03 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

This patch is a forward port of the following commit:

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=72ba7b1274faf37451b1641ee51140f53f4b7098

commit 72ba7b1274faf37451b1641ee51140f53f4b7098
Author:     rbu <rbu@gentoo.org>
AuthorDate: 2009-08-18 17:47:20 +0000
Commit:     rbu <rbu@gentoo.org>
CommitDate: 2009-08-18 17:47:20 +0000

    Make --pretend output in glsa-check nicer. Add colors and fix linebreaks.

    svn path=/trunk/gentoolkit/; revision=670

Bug: https://bugs.gentoo.org/693088
Signed-off-by: Zac Medico <zmedico@gentoo.org>
---
 bin/glsa-check | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index 3502812d9..bf81eca63 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -263,13 +263,23 @@ if mode in ["dump", "fix", "inject", "pretend"]:
 				for (vuln, update) in myglsa.getAffectionTable(least_change=least_change):
 					mergedict.setdefault(update, []).append(vuln)
 
+				# first, extract the atoms that cannot be upgraded (where key == "")
+				no_upgrades = []
 				sys.stdout.write(">>> The following updates will be performed for this GLSA:\n")
-				for pkg in mergedict:
-					if pkg != "":
-						sys.stdout.write("     " + pkg + " (vulnerable: " + ", ".join(mergedict[pkg]) + ")\n")
 				if "" in mergedict:
-					sys.stdout.write("\n>>> For the following packages, no upgrade path exists:\n")
-					sys.stdout.write("     " + ", ".join(mergedict[""]))
+					no_upgrades = mergedict[""]
+					del mergedict[""]
+
+				# see if anything is left that can be upgraded
+				if mergedict:
+					sys.stdout.write(">>> Updates that will be performed:\n")
+					for (upd, vuln) in mergedict.items():
+						sys.stdout.write("     " + green(upd) + " (vulnerable: " + red(", ".join(vuln)) + ")\n")
+
+				if no_upgrades:
+					sys.stdout.write(">>> No upgrade path exists for these packages:\n")
+					sys.stdout.write("     " + red(", ".join(no_upgrades)) + "\n")
+			sys.stdout.write("\n")
 		elif mode == "inject":
 			sys.stdout.write("injecting " + myid + "\n")
 			myglsa.inject()
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-portage-dev] [PATCH 3/3] glsa-check: Remove 'new' target from glsa-list
  2019-08-30 23:03 [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088) Zac Medico
  2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 1/3] glsa-check: Fix traceback with glsa-check -f (Bug 275105) Zac Medico
  2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 2/3] glsa-check: Make --pretend output nicer Zac Medico
@ 2019-08-30 23:03 ` Zac Medico
  2019-08-31  2:34 ` [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088) Aaron Bauman
  3 siblings, 0 replies; 5+ messages in thread
From: Zac Medico @ 2019-08-30 23:03 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

This patch is a forward port of the following commit:

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=8190a7299a618e0ce120fe1c894b944075576342

commit 8190a7299a618e0ce120fe1c894b944075576342
Author:     rbu <rbu@gentoo.org>
AuthorDate: 2009-08-18 18:25:59 +0000
Commit:     rbu <rbu@gentoo.org>
CommitDate: 2009-08-18 18:25:59 +0000

    Remove 'new' target from glsa-list

    Everyone should use 'affected' or 'all'
    Update man page and changelog

    svn path=/trunk/gentoolkit/; revision=672

Bug: https://bugs.gentoo.org/693088
Signed-off-by: Zac Medico <zmedico@gentoo.org>
---
 bin/glsa-check | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
index bf81eca63..7a6916d15 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -26,7 +26,7 @@ __version__ = "1.0.1"
 # option parsing
 epilog = "glsa-list can contain an arbitrary number of GLSA ids," \
 		" filenames containing GLSAs or the special identifiers" \
-		" 'all', 'new' and 'affected'"
+		" 'all' and 'affected'"
 parser = argparse.ArgumentParser(usage=__program__ + " <option> [glsa-id | all | new | affected]",
 	epilog=epilog)
 
@@ -64,7 +64,7 @@ parser.add_argument("-v", "--verbose", action="store_true", dest="verbose",
 parser.add_argument("-n", "--nocolor", action="store_true",
 		help="Removes color from output")
 parser.add_argument("-e", "--emergelike", action="store_false", dest="least_change",
-		help="Do not use a least-change algorithm")
+		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")
 
@@ -101,7 +101,7 @@ elif mode in ["fix", "inject"] and os.geteuid() != 0:
 	sys.stderr.write("\nThis tool needs root access to "+options.mode+" this GLSA\n\n")
 	sys.exit(2)
 elif mode == "list" and not params:
-	params.append("new")
+	params.append("affected")
 
 # delay this for speed increase
 from portage.glsa import (Glsa, GlsaTypeException, GlsaFormatException,
@@ -119,14 +119,15 @@ todolist = [e for e in completelist if e not in checklist]
 
 glsalist = []
 if "new" in params:
-	glsalist = todolist
 	params.remove("new")
+	sys.stderr.write("Warning: The 'new' glsa-list target has been removed, using 'affected'.\n")
+	params.append("affected")
 
 if "all" in params:
 	glsalist = completelist
 	params.remove("all")
+
 if "affected" in params:
-	# replaced completelist with todolist on request of wschlich
 	for x in todolist:
 		try:
 			myglsa = Glsa(x, portage.settings, vardb, portdb)
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088)
  2019-08-30 23:03 [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088) Zac Medico
                   ` (2 preceding siblings ...)
  2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 3/3] glsa-check: Remove 'new' target from glsa-list Zac Medico
@ 2019-08-31  2:34 ` Aaron Bauman
  3 siblings, 0 replies; 5+ messages in thread
From: Aaron Bauman @ 2019-08-31  2:34 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

On Fri, Aug 30, 2019 at 04:03:11PM -0700, Zac Medico wrote:
> Bug: https://bugs.gentoo.org/693088
> 
> Zac Medico (3):
>   glsa-check: Fix traceback with glsa-check -f (Bug 275105)
>   glsa-check: Make --pretend output nicer
>   glsa-check: Remove 'new' target from glsa-list
> 
>  bin/glsa-check | 35 +++++++++++++++++++++++------------
>  1 file changed, 23 insertions(+), 12 deletions(-)
> 
> -- 
> 2.21.0
> 

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] 5+ messages in thread

end of thread, other threads:[~2019-08-31  2:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-30 23:03 [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088) Zac Medico
2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 1/3] glsa-check: Fix traceback with glsa-check -f (Bug 275105) Zac Medico
2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 2/3] glsa-check: Make --pretend output nicer Zac Medico
2019-08-30 23:03 ` [gentoo-portage-dev] [PATCH 3/3] glsa-check: Remove 'new' target from glsa-list Zac Medico
2019-08-31  2:34 ` [gentoo-portage-dev] [PATCH 0/3] glsa-check: forward port remaining changes from gentoolkit (bug 693088) Aaron Bauman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox