Print [ OK ] messages (like eend) when checksums are good. Thanks to fox2mike for...
authorZac Medico <zmedico@gentoo.org>
Sun, 30 Apr 2006 08:02:20 +0000 (08:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 30 Apr 2006 08:02:20 +0000 (08:02 -0000)
svn path=/main/trunk/; revision=3279

pym/output.py
pym/portage.py

index 6884e504a9a68426d5aea2f59c3d1526dd9e1fdc..5d5247bed4ecf293fa00a7066d75a962aec78911 100644 (file)
@@ -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$")
index 781d2b36b8c2966a495f17d5036f8f495537631e..1acfed746df6a730c65e96300f1348df9f6cc51e 100644 (file)
@@ -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])