Make BinpkgVerifier rename files that fail verification, similar to how
authorZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:39:01 +0000 (21:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:39:01 +0000 (21:39 -0000)
distfiles are automatically renamed. (trunk r12197)

svn path=/main/branches/2.1.6/; revision=12230

pym/_emerge/__init__.py

index deb92eeb559d27a073fe9346965a9d52a815385d..3a5d82cec0b5c73d6b0647031c31c135e18fbd20 100644 (file)
@@ -3505,6 +3505,12 @@ class BinpkgVerifier(AsynchronousTask):
                                writemsg("!!! Expected: %s\n" % e.value[3],
                                        noiselevel=-1)
                                rval = 1
+                       if rval != os.EX_OK:
+                               pkg_path = bintree.getname(pkg.cpv)
+                               head, tail = os.path.split(pkg_path)
+                               temp_filename = portage._checksum_failure_temp_file(head, tail)
+                               writemsg("File renamed to '%s'\n" % (temp_filename,),
+                                       noiselevel=-1)
                finally:
                        sys.stdout = stdout_orig
                        sys.stderr = stderr_orig