From: Zac Medico Date: Sun, 7 Aug 2011 05:59:26 +0000 (-0700) Subject: fetch: handle non-essential statvfs failure X-Git-Tag: v2.2.0_alpha51~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a7abc7529df54ee300d56a7d33cc87b5af0e298b;p=portage.git fetch: handle non-essential statvfs failure --- 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: