Inside digestgen(), don't unnecessarily call fetch() in cases when the there
authorZac Medico <zmedico@gentoo.org>
Wed, 14 Jan 2009 03:58:08 +0000 (03:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 14 Jan 2009 03:58:08 +0000 (03:58 -0000)
are no hashes for comparison and the file already exists in $DISTDIR.
(trunk r12499)

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

pym/portage/__init__.py

index 2c33e52b6b3092c08a21174dd835f37cdca933b9..a6ef919dee0df650ef7ec3512d262d11e67891a0 100644 (file)
@@ -4234,7 +4234,12 @@ def digestgen(myarchives, mysettings, overwrite=1, manifestonly=0, myportdb=None
                for myfile in distfiles_map:
                        myhashes = dist_hashes.get(myfile)
                        if not myhashes:
-                               missing_files.append(myfile)
+                               try:
+                                       st = os.stat(os.path.join(mysettings["DISTDIR"], myfile))
+                               except OSError:
+                                       st = None
+                               if st is None or st.st_size == 0:
+                                       missing_files.append(myfile)
                                continue
                        size = myhashes.get("size")