[yum-cvs] yum/yum __init__.py,1.250,1.251

Menno Smits mjs at linux.duke.edu
Mon Sep 11 10:12:39 UTC 2006


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv6869/yum

Modified Files:
	__init__.py 
Log Message:
Fixed the disk space check; it was failing because po.size can be a string. 
Make the disk space check more readable by using the statvfs attributes.


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.250
retrieving revision 1.251
diff -u -r1.250 -r1.251
--- __init__.py	11 Sep 2006 09:56:19 -0000	1.250
+++ __init__.py	11 Sep 2006 10:12:36 -0000	1.251
@@ -625,7 +625,7 @@
             local = po.localPkg()
             if os.path.exists(local):
                 cursize = os.stat(local)[6]
-                totsize = int(po.size)
+                totsize = long(po.size)
                 if not po.verifyLocalPkg():
                     if po.repo.cache:
                         repo_cached = True
@@ -648,8 +648,8 @@
         for po in remote_pkgs:
             i += 1
             checkfunc = (self.verifyPkg, (po, 1), {})
-            stvfs = os.statvfs(po.repo.pkgdir)
-            if stvfs[4] * stvfs[0] <= po.size:
+            dirstat = os.statvfs(po.repo.pkgdir)
+            if (dirstat.f_bavail * dirstat.f_bsize) <= long(po.size):
                 adderror(po, 'Insufficient space in download directory %s '
                         'to download' % po.repo.pkgdir)
                 continue




More information about the Yum-cvs-commits mailing list