diff options
Diffstat (limited to 'bitbake/lib/bb/fetch')
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 39 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch/svn.py | 9 |
2 files changed, 26 insertions, 22 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 | ||
159 | def localpaths(d): | 160 | def 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) |
diff --git a/bitbake/lib/bb/fetch/svn.py b/bitbake/lib/bb/fetch/svn.py index ca12efe158..af8543ab34 100644 --- a/bitbake/lib/bb/fetch/svn.py +++ b/bitbake/lib/bb/fetch/svn.py | |||
@@ -74,11 +74,14 @@ class Svn(Fetch): | |||
74 | ud.revision = "" | 74 | ud.revision = "" |
75 | else: | 75 | else: |
76 | rev = data.getVar("SRCREV", d, 0) | 76 | rev = data.getVar("SRCREV", d, 0) |
77 | if "get_srcrev" in rev: | 77 | if rev and "get_srcrev" in rev: |
78 | ud.revision = self.latest_revision(url, ud, d) | 78 | ud.revision = self.latest_revision(url, ud, d) |
79 | else: | 79 | ud.date = "" |
80 | elif rev: | ||
80 | ud.revision = rev | 81 | ud.revision = rev |
81 | ud.date = "" | 82 | ud.date = "" |
83 | else: | ||
84 | ud.revision = "" | ||
82 | 85 | ||
83 | ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d) | 86 | ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d) |
84 | 87 | ||