summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-08-06 22:59:26 -0700
committerZac Medico <zmedico@gentoo.org>2011-08-06 22:59:26 -0700
commita7abc7529df54ee300d56a7d33cc87b5af0e298b (patch)
tree1933d667ccdabbf8eca72e89a9aca2aec55c312c
parent2c92ae3c7ddb903bcffe96046cebe8106439e86b (diff)
downloadportage-a7abc7529df54ee300d56a7d33cc87b5af0e298b.tar.gz
portage-a7abc7529df54ee300d56a7d33cc87b5af0e298b.tar.bz2
portage-a7abc7529df54ee300d56a7d33cc87b5af0e298b.zip
fetch: handle non-essential statvfs failure
-rw-r--r--pym/portage/package/ebuild/fetch.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py
index 2ae1fe85b..5cbbf8708 100644
--- a/pym/portage/package/ebuild/fetch.py
+++ b/pym/portage/package/ebuild/fetch.py
@@ -580,8 +580,17 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
else:
# check if there is enough space in DISTDIR to completely store myfile
# overestimate the filesize so we aren't bitten by FS overhead
+ vfs_stat = None
if size is not None and hasattr(os, "statvfs"):
- vfs_stat = os.statvfs(mysettings["DISTDIR"])
+ try:
+ vfs_stat = os.statvfs(mysettings["DISTDIR"])
+ except OSError as e:
+ writemsg_level("!!! statvfs('%s'): %s\n" %
+ (mysettings["DISTDIR"], e),
+ noiselevel=-1, level=logging.ERROR)
+ del e
+
+ if vfs_stat is not None:
try:
mysize = os.stat(myfile_path).st_size
except OSError as e: