summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 66ff4ce29..6a253764f 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -3243,8 +3243,16 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
# overestimate the filesize so we aren't bitten by FS overhead
if hasattr(os, "statvfs"):
vfs_stat = os.statvfs(mysettings["DISTDIR"])
+ try:
+ mysize = os.stat(myfile_path)
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+ mysize = 0
if myfile in mydigests \
- and (mydigests[myfile]["size"] + vfs_stat.f_bsize) >= (vfs_stat.f_bsize * vfs_stat.f_bavail):
+ and (mydigests[myfile]["size"] - mysize + vfs_stat.f_bsize) >= \
+ (vfs_stat.f_bsize * vfs_stat.f_bavail):
writemsg("!!! Insufficient space to store %s in %s\n" % (myfile, mysettings["DISTDIR"]), noiselevel=-1)
has_space = False