diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-18 14:43:20 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-18 14:43:20 +0000 |
commit | c7f8a7ea848dd0da5aafa8f194552c6316e38ea0 (patch) | |
tree | 8eb9756978ca8305e7979e41a06c2b107f71dd05 /lib/bb/fetch | |
parent | 531ea59fab144ec011018680b601c24c439136a9 (diff) | |
download | bitbake-c7f8a7ea848dd0da5aafa8f194552c6316e38ea0.tar.gz |
fetch/__init__.py: Don't create .lock files for local files
Diffstat (limited to 'lib/bb/fetch')
-rw-r--r-- | lib/bb/fetch/__init__.py | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index bbff516ff..41dca017b 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -135,26 +135,27 @@ def go(d): for u in urldata: ud = urldata[u] m = ud.method - if ud.localfile and not m.forcefetch(u, ud, d) and os.path.exists(ud.md5): - # File already present along with md5 stamp file - # Touch md5 file to show activity - os.utime(ud.md5, None) - continue - lf = open(ud.lockfile, "a+") - fcntl.flock(lf.fileno(), fcntl.LOCK_EX) - if ud.localfile and 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) + if ud.localfile: + if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5): + # File already present along with md5 stamp file + # Touch md5 file to show activity + os.utime(ud.md5, None) + continue + lf = open(ud.lockfile, "a+") + fcntl.flock(lf.fileno(), fcntl.LOCK_EX) + 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 + 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 - continue - m.go(u, ud, d) - if ud.localfile and not m.forcefetch(u, ud, d): - Fetch.write_md5sum(u, ud, d) - fcntl.flock(lf.fileno(), fcntl.LOCK_UN) - lf.close - def localpaths(d): """ |