summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-30 08:02:20 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-30 08:02:20 +0000
commit50411e6d3b8dbf27a95ffe85280712be2594feea (patch)
tree7f04c6c65b39f7a58984687070aba1d1742e1a0d
parent4e096b313e78e7386bf8ff52339429d173e6873a (diff)
downloadportage-50411e6d3b8dbf27a95ffe85280712be2594feea.tar.gz
portage-50411e6d3b8dbf27a95ffe85280712be2594feea.tar.bz2
portage-50411e6d3b8dbf27a95ffe85280712be2594feea.zip
Print [ OK ] messages (like eend) when checksums are good. Thanks to fox2mike for suggesting this.
svn path=/main/trunk/; revision=3279
-rw-r--r--pym/output.py7
-rw-r--r--pym/portage.py18
2 files changed, 20 insertions, 5 deletions
diff --git a/pym/output.py b/pym/output.py
index 6884e504a..5d5247bed 100644
--- a/pym/output.py
+++ b/pym/output.py
@@ -116,6 +116,13 @@ codes["darkyellow"] = codes["brown"]
codes["fuscia"] = codes["fuchsia"]
codes["white"] = codes["bold"]
+# Colors from /sbin/functions.sh
+codes["GOOD"] = codes["green"]
+codes["WARN"] = codes["yellow"]
+codes["BAD"] = codes["red"]
+codes["HILITE"] = codes["teal"]
+codes["BRACKET"] = codes["blue"]
+
def parse_color_map():
myfile = COLOR_MAP_FILE
ansi_code_pattern = re.compile("^[0-9;]*m$")
diff --git a/pym/portage.py b/pym/portage.py
index 781d2b36b..1acfed746 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -2269,18 +2269,26 @@ def digestcheck(myfiles, mysettings, strict=0, justmanifest=0):
if strict:
return 0
mf = Manifest(pkgdir, mysettings["DISTDIR"])
+ codes = output.codes
+ okaymsg = "%s[%s %sOK%s %s]%s\n" % (codes["BRACKET"], codes["reset"],
+ codes["GOOD"], codes["reset"], codes["BRACKET"], codes["reset"])
+ mywidth = 33
try:
- writemsg_stdout(">>> checking ebuild checksums\n")
+ writemsg_stdout(">>> checking ebuild checksums".ljust(mywidth))
mf.checkTypeHashes("EBUILD")
- writemsg_stdout(">>> checking auxfile checksums\n")
+ writemsg_stdout(okaymsg)
+ writemsg_stdout(">>> checking auxfile checksums".ljust(mywidth))
mf.checkTypeHashes("AUX")
- writemsg_stdout(">>> checking miscfile checksums\n")
+ writemsg_stdout(okaymsg)
+ writemsg_stdout(">>> checking miscfile checksums".ljust(mywidth))
mf.checkTypeHashes("MISC", ignoreMissingFiles=True)
- writemsg_stdout(">>> checking distfiles checksums\n")
+ writemsg_stdout(okaymsg)
+ writemsg_stdout(">>> checking distfiles checksums".ljust(mywidth))
for f in myfiles:
mf.checkFileHashes(mf.findFile(f), f)
+ writemsg_stdout(okaymsg)
except portage_exception.DigestException, e:
- writemsg("!!! Digest verification failed:\n")
+ writemsg("\n!!! Digest verification failed:\n")
writemsg("!!! %s\n" % e.value[0])
writemsg("!!! Reason: %s\n" % e.value[1])
writemsg("!!! Got: %s\n" % e.value[2])