]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: Add some sanity checks to the lockfile functions
authorRichard Purdie <richard@openedhand.com>
Fri, 17 Oct 2008 11:04:26 +0000 (11:04 +0000)
committerRichard Purdie <richard@openedhand.com>
Fri, 17 Oct 2008 11:04:26 +0000 (11:04 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5534 311d38ba-8fff-0310-9ca6-ca027cbcb966

bitbake-dev/lib/bb/utils.py
bitbake/lib/bb/utils.py

index 94bc62f7cf77e58f0a44b2bed9f7ccdab0b7e192..ad1a515292a61c9e00f1ac386d140755f7cdc62d 100644 (file)
@@ -235,6 +235,12 @@ def lockfile(name):
     Use the file fn as a lock file, return when the lock has been acquired.
     Returns a variable to pass to unlockfile().
     """
+    path = os.path.dirname(name)
+    if not os.path.isdir(path):
+        import bb, sys
+        bb.msg.error(bb.msg.domain.Util, "Error, lockfile path does not exist!: %s" % path)
+        sys.exit(1)
+
     while True:
         # If we leave the lockfiles lying around there is no problem
         # but we should clean up after ourselves. This gives potential
index 0f402f62796e950a9e101718af63222f0b52590d..9641b988abb86b77c4783c334e0af62dce470669 100644 (file)
@@ -235,6 +235,12 @@ def lockfile(name):
     Use the file fn as a lock file, return when the lock has been acquired.
     Returns a variable to pass to unlockfile().
     """
+    path = os.path.dirname(name)
+    if not os.path.isdir(path):
+        import bb, sys
+        bb.msg.error(bb.msg.domain.Util, "Error, lockfile path does not exist!: %s" % path)
+        sys.exit(1)
+
     while True:
         # If we leave the lockfiles lying around there is no problem
         # but we should clean up after ourselves. This gives potential