Added some extra debug output to catalyst_lock.py and added Stuart Longland to AUTHOR...
authorChris Gianelloni <wolf31o2@gentoo.org>
Wed, 20 Feb 2008 19:46:56 +0000 (19:46 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Wed, 20 Feb 2008 19:46:56 +0000 (19:46 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1316 d1e1f19c-881f-0410-ab34-b69fee027534

AUTHORS
ChangeLog
catalyst
modules/builder.py
modules/catalyst_lock.py

diff --git a/AUTHORS b/AUTHORS
index 5199ba78e0a596e7416d0de92daff80b635fa09d..daea24f50a13e29a745b7933972866c4f6a3fb14 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -20,3 +20,4 @@ Lars Weiler <pylon@gentoo.org>
 Andrew Gaffney <agaffney@gentoo.org>
 Diego Pettenò <flameeyes@gentoo.org>
 Robin H. Johnson <robbat2@gentoo.org>
+Stuart Longland <redhatter@gentoo.org>
index 280cc9f1636e9bc0908f1e37bfdf1d3510c5622e..fd84577359d716ae71fd8df3549a1ba8e5c7d2eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Id: $
 
+  20 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org> AUTHORS, catalyst,
+  modules/builder.py, modules/catalyst_lock.py:
+  Added some extra debug output to catalyst_lock.py and added Stuart Longland
+  to AUTHORS. This is catalyst 2.0.6_pre7 for testing.
+
   20 Feb 2008; Andrew Gaffney <agaffney@gentoo.org>
   modules/catalyst_support.py:
   change 'is' to == because python is grumpy
index 558405fb3eff0de60a1bb40d239f86e391392f07..4c917c1f0b9fbc37d74e0f35ef25bc29a9301d49 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -8,7 +8,7 @@ import os,sys,imp,string,getopt
 import pdb
 
 __maintainer__="Chris Gianelloni <wolf31o2@gentoo.org>"
-__version__="2.0.6_pre6"
+__version__="2.0.6_pre7"
 
 conf_values={}
 
index d422d48b2755fb3b27380e175f79a2466d11523d..a1cf73cd363facbfcee085352e7006ff41bfc729 100644 (file)
@@ -3,9 +3,11 @@ class generic:
        def __init__(self,myspec):
                self.settings=myspec
        def mount_safety_check(self):
-               """make sure that no bind mounts exist in chrootdir (to use before
+               """
+               Make sure that no bind mounts exist in chrootdir (to use before
                cleaning the directory, to make sure we don't wipe the contents of
-               a bind mount"""
+               a bind mount
+               """
                pass
        def mount_all(self):
                """do all bind mounts"""
index dbbeef5f2c45a9c52cd95e4620e77ce87bfbca82..f17f9a8635e7e5ad365b8bad729ba5cb63f11ed7 100755 (executable)
@@ -58,7 +58,8 @@ class LockDir:
 
        def set_gid(self,gid):
                if not self.islocked():
-                       #print "setting gid to", gid 
+                       if self.settings.has_key("DEBUG"):
+                               print "setting gid to", gid 
                        self.gid=gid
 
        def set_lockdir(self,lockdir):
@@ -69,20 +70,23 @@ class LockDir:
                                if lockdir[-1] == "/":
                                        lockdir=lockdir[:-1]
                                self.lockdir=normpath(lockdir)
-                               #print "setting lockdir to", self.lockdir
+                               if self.settings.has_key("DEBUG"):
+                                       print "setting lockdir to", self.lockdir
                else:
                        raise "the lock object needs a path to a dir"
 
        def set_lockfilename(self,lockfilename):
                if not self.islocked():
                        self.lockfilename=lockfilename
-                       #print "setting lockfilename to", self.lockfilename
+                       if self.settings.has_key("DEBUG"):
+                               print "setting lockfilename to", self.lockfilename
        
        def set_lockfile(self):
                if not self.islocked():
                        self.lockfile=normpath(self.lockdir+'/'+self.lockfilename)
-                       #print "setting lockfile to", self.lockfile
-    
+                       if self.settings.has_key("DEBUG"):
+                               print "setting lockfile to", self.lockfile
+
        def read_lock(self):
                if not self.locking_method == "HARDLOCK":
                        self.fcntl_lock("read")
@@ -135,10 +139,10 @@ class LockDir:
                                raise
                        if e.errno == errno.EAGAIN:
                                if not LockDir.die_on_failed_lock:
-                                       # resource temp unavailable; eg, someone beat us to the lock.
+                                       # Resource temp unavailable; eg, someone beat us to the lock.
                                        writemsg("waiting for lock on %s\n" % self.lockfile)
 
-                                       # try for the exclusive or shared lock again.
+                                       # Try for the exclusive or shared lock again.
                                        if locktype == "read":
                                                self.locking_method(self.myfd,fcntl.LOCK_SH)
                                        else:
@@ -197,16 +201,17 @@ class LockDir:
                                                except:
                                                        print "Read lock may be in effect. skipping lockfile delete..."
                                                        InUse=True
-                                                       ### We won the lock, so there isn't competition for it.
-                                                       ### We can safely delete the file.
-                                                       ###writemsg("Got the lockfile...\n")
-                                                       ###writemsg("Unlinking...\n")
+                                                       # We won the lock, so there isn't competition for it.
+                                                       # We can safely delete the file.
+                                                       #writemsg("Got the lockfile...\n")
+                                                       #writemsg("Unlinking...\n")
                                                        self.locking_method(self.myfd,fcntl.LOCK_UN)
                                        if not InUse:
                                                os.unlink(self.lockfile)
                                                os.close(self.myfd)
                                                self.myfd=None
-                                               #print "Unlinked lockfile..."
+                                               if self.settings.has_key("DEBUG"):
+                                                       print "Unlinked lockfile..."
                                except SystemExit, e:
                                        raise
                                except Exception, e:
@@ -215,7 +220,7 @@ class LockDir:
                                        print "Failed to get lock... someone took it."
                                        print str(e)
 
-                                       # why test lockfilename?  because we may have been handed an
+                                       # Why test lockfilename?  Because we may have been handed an
                                        # fd originally, and the caller might not like having their
                                        # open fd closed automatically on them.
                                        #if type(lockfilename) == types.StringType:
@@ -254,8 +259,9 @@ class LockDir:
                        except SystemExit, e:
                                raise
                        except Exception, e:
-                               #print "lockfile(): Hardlink: Link failed."
-                               #print "Exception: ",e
+                               if self.settings.has_key("DEBUG"):
+                                       print "lockfile(): Hardlink: Link failed."
+                                       print "Exception: ",e
                                pass
 
                        if self.hardlink_is_mine(self.myhardlock, self.lockfile):