summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index bbff516ffc..c34405738b 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -135,26 +135,27 @@ def go(d):
135 for u in urldata: 135 for u in urldata:
136 ud = urldata[u] 136 ud = urldata[u]
137 m = ud.method 137 m = ud.method
138 if ud.localfile and not m.forcefetch(u, ud, d) and os.path.exists(ud.md5): 138 if ud.localfile:
139 # File already present along with md5 stamp file 139 if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
140 # Touch md5 file to show activity 140 # File already present along with md5 stamp file
141 os.utime(ud.md5, None) 141 # Touch md5 file to show activity
142 continue 142 os.utime(ud.md5, None)
143 lf = open(ud.lockfile, "a+") 143 continue
144 fcntl.flock(lf.fileno(), fcntl.LOCK_EX) 144 lf = open(ud.lockfile, "a+")
145 if ud.localfile and not m.forcefetch(u, ud, d) and os.path.exists(ud.md5): 145 fcntl.flock(lf.fileno(), fcntl.LOCK_EX)
146 # If someone else fetched this before we got the lock, 146 if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
147 # notice and don't try again 147 # If someone else fetched this before we got the lock,
148 os.utime(ud.md5, None) 148 # notice and don't try again
149 os.utime(ud.md5, None)
150 fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
151 lf.close
152 continue
153 m.go(u, ud, d)
154 if ud.localfile:
155 if not m.forcefetch(u, ud, d):
156 Fetch.write_md5sum(u, ud, d)
149 fcntl.flock(lf.fileno(), fcntl.LOCK_UN) 157 fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
150 lf.close 158 lf.close
151 continue
152 m.go(u, ud, d)
153 if ud.localfile and not m.forcefetch(u, ud, d):
154 Fetch.write_md5sum(u, ud, d)
155 fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
156 lf.close
157
158 159
159def localpaths(d): 160def localpaths(d):
160 """ 161 """
@@ -339,7 +340,7 @@ class Fetch(object):
339 pn = data.getVar("PN", d, 1) 340 pn = data.getVar("PN", d, 1)
340 341
341 if pn: 342 if pn:
342 return data.getVar("SRCDATE_%s" % pn, d, 1) or data.getVar("CVSDATE_%s" % pn, d, 1) or data.getVar("DATE", d, 1) 343 return data.getVar("SRCDATE_%s" % pn, d, 1) or data.getVar("CVSDATE_%s" % pn, d, 1) or data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
343 344
344 return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1) 345 return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
345 getSRCDate = staticmethod(getSRCDate) 346 getSRCDate = staticmethod(getSRCDate)