verify_all occasionally returns longs rather then strings.
authorBrian Harring <ferringb@gentoo.org>
Mon, 23 Jan 2006 00:01:31 +0000 (00:01 -0000)
committerBrian Harring <ferringb@gentoo.org>
Mon, 23 Jan 2006 00:01:31 +0000 (00:01 -0000)
Wouldn't be a problem, but the writemsg code isn't written to do conversions on the fly... so, made it so it was.

svn path=/main/trunk/; revision=2570

pym/portage.py

index 0bf16c6be3d63bb9036c7db39051dcf92443af95..e05d311c58bc7513deb8c6198b659df1ea478ef5 100644 (file)
@@ -1927,10 +1927,10 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                                                # Verify checksums at each fetch for fetchonly.
                                                                verified_ok,reason = portage_checksum.verify_all(mysettings["DISTDIR"]+"/"+myfile, mydigests[myfile])
                                                                if not verified_ok:
+                                                                       print reason
                                                                        writemsg("!!! Previously fetched file: "+str(myfile)+"\n")
                                                                        writemsg("!!! Reason: "+reason[0]+"\n")
-                                                                       writemsg("!!! Got:      "+reason[1]+"\n")
-                                                                       writemsg("!!! Expected: "+reason[2]+"\n")
+                                                                       writemsg("!!! Got:      %s\n!!! Expected: %s\n" % (reason[0], reason[1]))
                                                                        writemsg("Refetching...\n\n")
                                                                        os.unlink(mysettings["DISTDIR"]+"/"+myfile)
                                                                        fetched=0
@@ -2030,10 +2030,10 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                                                # from another mirror...
                                                                verified_ok,reason = portage_checksum.verify_all(mysettings["DISTDIR"]+"/"+myfile, mydigests[myfile])
                                                                if not verified_ok:
+                                                                       print reason
                                                                        writemsg("!!! Fetched file: "+str(myfile)+" VERIFY FAILED!\n")
                                                                        writemsg("!!! Reason: "+reason[0]+"\n")
-                                                                       writemsg("!!! Got:      "+reason[1]+"\n")
-                                                                       writemsg("!!! Expected: "+reason[2]+"\n")
+                                                                       writemsg("!!! Got:      %s\n!!! Expected: %s\n" % (reason[0], reason[1]))
                                                                        writemsg("Removing corrupt distfile...\n")
                                                                        os.unlink(mysettings["DISTDIR"]+"/"+myfile)
                                                                        fetched=0