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

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

pym/portage/__init__.py

index 710496eec1c63d80c7fa16b5738dff4630943db0..1f122bdf5dc78fbdc9f45c7ebe0d340c8bfa8144 100644 (file)
@@ -4244,7 +4244,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")