- Add plain message function to bb.msg
- Sort the list of providers before processing so dependency problems are
reproducible rather than effectively random
+ - Add locking for fetchers so only one tries to fetch a given file at
+ a given time
+
Changes in Bitbake 1.8.6:
- Correctly redirect stdin when forking
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import os, re
+import os, re, fcntl
import bb
from bb import data
from bb import persist_data
# 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)
+ 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):
"""
else:
self.localpath = self.method.localpath(self.url, self, d)
self.md5 = self.localpath + '.md5'
+ self.lockfile = self.localpath + '.lock'
# if user sets localpath for file, use it instead.