Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9505 - main/trunk/pym/portage
Date: Tue, 25 Mar 2008 03:51:55
Message-Id: E1Je0CW-0007ug-Ur@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-03-25 03:51:51 +0000 (Tue, 25 Mar 2008)
3 New Revision: 9505
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 Log:
8 Bug #212152 - Account pre-existing files when calculating whether there
9 is enough space for a download.
10
11
12 Modified: main/trunk/pym/portage/__init__.py
13 ===================================================================
14 --- main/trunk/pym/portage/__init__.py 2008-03-25 03:18:28 UTC (rev 9504)
15 +++ main/trunk/pym/portage/__init__.py 2008-03-25 03:51:51 UTC (rev 9505)
16 @@ -3243,8 +3243,16 @@
17 # overestimate the filesize so we aren't bitten by FS overhead
18 if hasattr(os, "statvfs"):
19 vfs_stat = os.statvfs(mysettings["DISTDIR"])
20 + try:
21 + mysize = os.stat(myfile_path)
22 + except OSError, e:
23 + if e.errno != errno.ENOENT:
24 + raise
25 + del e
26 + mysize = 0
27 if myfile in mydigests \
28 - and (mydigests[myfile]["size"] + vfs_stat.f_bsize) >= (vfs_stat.f_bsize * vfs_stat.f_bavail):
29 + and (mydigests[myfile]["size"] - mysize + vfs_stat.f_bsize) >= \
30 + (vfs_stat.f_bsize * vfs_stat.f_bavail):
31 writemsg("!!! Insufficient space to store %s in %s\n" % (myfile, mysettings["DISTDIR"]), noiselevel=-1)
32 has_space = False
33
34
35 --
36 gentoo-commits@l.g.o mailing list