is enough space for a download.
svn path=/main/trunk/; revision=9505
# 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