1 |
Author: zmedico |
2 |
Date: 2008-03-24 23:05:00 +0000 (Mon, 24 Mar 2008) |
3 |
New Revision: 9502 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/__init__.py |
7 |
Log: |
8 |
Check is os.statvfs() is implemented before trying to us it. |
9 |
(branches/prefix r9500) |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/portage/__init__.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/portage/__init__.py 2008-03-24 15:09:50 UTC (rev 9501) |
15 |
+++ main/trunk/pym/portage/__init__.py 2008-03-24 23:05:00 UTC (rev 9502) |
16 |
@@ -3241,11 +3241,12 @@ |
17 |
else: |
18 |
# check if there is enough space in DISTDIR to completely store myfile |
19 |
# overestimate the filesize so we aren't bitten by FS overhead |
20 |
- vfs_stat = os.statvfs(mysettings["DISTDIR"]) |
21 |
- if myfile in mydigests \ |
22 |
- and (mydigests[myfile]["size"] + vfs_stat.f_bsize) >= (vfs_stat.f_bsize * vfs_stat.f_bavail): |
23 |
- writemsg("!!! Insufficient space to store %s in %s\n" % (myfile, mysettings["DISTDIR"]), noiselevel=-1) |
24 |
- has_space = False |
25 |
+ if hasattr(os, "statvfs"): |
26 |
+ vfs_stat = os.statvfs(mysettings["DISTDIR"]) |
27 |
+ if myfile in mydigests \ |
28 |
+ and (mydigests[myfile]["size"] + vfs_stat.f_bsize) >= (vfs_stat.f_bsize * vfs_stat.f_bavail): |
29 |
+ writemsg("!!! Insufficient space to store %s in %s\n" % (myfile, mysettings["DISTDIR"]), noiselevel=-1) |
30 |
+ has_space = False |
31 |
|
32 |
if use_locks and can_fetch: |
33 |
waiting_msg = None |
34 |
|
35 |
-- |
36 |
gentoo-commits@l.g.o mailing list |