summaryrefslogtreecommitdiff
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-11-24 16:49:12 +0000
committerRichard Purdie <richard@openedhand.com>2007-11-24 16:49:12 +0000
commit62a3ee38ed1076de75d40f56c757098b6c219810 (patch)
treec1fca17266f850a3093493c173da2b7a9d553e39 /bitbake/lib
parentc0659779483182aff39d8e8a6821a40d1489dc0f (diff)
downloadopenembedded-core-62a3ee38ed1076de75d40f56c757098b6c219810.tar.gz
openembedded-core-62a3ee38ed1076de75d40f56c757098b6c219810.tar.bz2
openembedded-core-62a3ee38ed1076de75d40f56c757098b6c219810.tar.xz
openembedded-core-62a3ee38ed1076de75d40f56c757098b6c219810.zip
bitbake: Convert fetcher code to using bb.utils locking functions
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3223 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 4da92110e..d75c618de 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -141,21 +141,18 @@ def go(d):
# Touch md5 file to show activity
os.utime(ud.md5, None)
continue
- lf = open(ud.lockfile, "a+")
- fcntl.flock(lf.fileno(), fcntl.LOCK_EX)
+ lf = bb.utils.lockfile(ud.lockfile)
if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
# If someone else fetched this before we got the lock,
# notice and don't try again
os.utime(ud.md5, None)
- fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
- lf.close
+ bb.utils.unlockfile(lf)
continue
m.go(u, ud, d)
if ud.localfile:
if not m.forcefetch(u, ud, d):
Fetch.write_md5sum(u, ud, d)
- fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
- lf.close
+ bb.utils.unlockfile(lf)
def localpaths(d):
"""