[yum-cvs] yum/yum __init__.py,1.97,1.98

Seth Vidal skvidal at login.linux.duke.edu
Tue Mar 15 07:33:21 UTC 2005


Update of /home/groups/yum/cvs/yum/yum
In directory login:/tmp/cvs-serv14631/yum

Modified Files:
	__init__.py 
Log Message:

make the lock file dir, if it is not present


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- __init__.py	14 Mar 2005 06:26:12 -0000	1.97
+++ __init__.py	15 Mar 2005 07:33:19 -0000	1.98
@@ -392,13 +392,16 @@
             return
         
         root = self.conf.installroot
-        lockfile = root + '/' + lockfile
+        lockfile = root + '/' + lockfile # lock in the chroot
         
         self._unlock(lockfile)
         
     def _lock(self, filename, contents='', mode=0777):
+        lockdir = os.path.dirname(filename)
         try:
-            fd = os.open(filename, os.O_EXCL|os.O_CREAT|os.O_WRONLY, mode)
+            if not os.path.exists(lockdir):
+                os.makedirs(lockdir, mode=0755)
+            fd = os.open(filename, os.O_EXCL|os.O_CREAT|os.O_WRONLY, mode)    
         except OSError, msg:
             if not msg.errno == errno.EEXIST: raise msg
             return 0




More information about the Yum-cvs-commits mailing list