From: vapier Date: Sun, 7 Mar 2010 01:37:57 +0000 (-0000) Subject: glsa-check: hide non-vuln glsas in quiet mode X-Git-Tag: gentoolkit-0.3.0_rc10~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d3e4aad5a03efbd5089f96558d2ddd1e9bf158a8;p=gentoolkit.git glsa-check: hide non-vuln glsas in quiet mode svn path=/trunk/gentoolkit/; revision=750 --- diff --git a/bin/glsa-check b/bin/glsa-check index ab83471..78fa86b 100755 --- a/bin/glsa-check +++ b/bin/glsa-check @@ -259,10 +259,14 @@ if mode in ["dump", "fix", "inject", "pretend"]: if mode == "dump": myglsa.dump() elif mode == "fix": - sys.stdout.write("Fixing GLSA "+myid+"\n") + if not quiet: + sys.stdout.write("Fixing GLSA "+myid+"\n") if not myglsa.isVulnerable(): - sys.stdout.write(">>> no vulnerable packages installed\n") + if not quiet: + sys.stdout.write(">>> no vulnerable packages installed\n") else: + if quiet: + sys.stdout.write("Fixing GLSA "+myid+"\n") mergelist = myglsa.getMergeList(least_change=least_change) if mergelist == []: sys.stdout.write(">>> cannot fix GLSA, no unaffected packages available\n") @@ -284,10 +288,14 @@ if mode in ["dump", "fix", "inject", "pretend"]: if len(mergelist): sys.stdout.write("\n") elif mode == "pretend": - sys.stdout.write("Checking GLSA "+myid+"\n") + if not quiet: + sys.stdout.write("Checking GLSA "+myid+"\n") if not myglsa.isVulnerable(): - sys.stdout.write(">>> no vulnerable packages installed\n") + if not quiet: + sys.stdout.write(">>> no vulnerable packages installed\n") else: + if quiet: + sys.stdout.write("Checking GLSA "+myid+"\n") mergedict = {} for (vuln, update) in myglsa.getAffectionTable(least_change=least_change): mergedict.setdefault(update, []).append(vuln) @@ -307,7 +315,6 @@ if mode in ["dump", "fix", "inject", "pretend"]: 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()