From: Richard Purdie Date: Fri, 17 Oct 2008 11:04:26 +0000 (+0000) Subject: bitbake: Add some sanity checks to the lockfile functions X-Git-Tag: 2011-1~7990 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=7a4b36a7d16114f0cef3b7fa6cb393d9cff1dafa;p=openembedded-core.git bitbake: Add some sanity checks to the lockfile functions git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5534 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- diff --git a/bitbake-dev/lib/bb/utils.py b/bitbake-dev/lib/bb/utils.py index 94bc62f7cf..ad1a515292 100644 --- a/bitbake-dev/lib/bb/utils.py +++ b/bitbake-dev/lib/bb/utils.py @@ -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 diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 0f402f6279..9641b988ab 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -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