diff options
Diffstat (limited to 'bitbake/lib/bb/fetch/__init__.py')
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index d9dfc7402d..4da92110ef 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py | |||
@@ -194,6 +194,7 @@ def get_srcrev(d): | |||
194 | return "SRCREVINACTION" | 194 | return "SRCREVINACTION" |
195 | 195 | ||
196 | scms = [] | 196 | scms = [] |
197 | |||
197 | # Only call setup_localpath on URIs which suppports_srcrev() | 198 | # Only call setup_localpath on URIs which suppports_srcrev() |
198 | urldata = init(bb.data.getVar('SRC_URI', d, 1).split(), d, False) | 199 | urldata = init(bb.data.getVar('SRC_URI', d, 1).split(), d, False) |
199 | for u in urldata: | 200 | for u in urldata: |
@@ -365,6 +366,34 @@ class Fetch(object): | |||
365 | return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1) | 366 | return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1) |
366 | getSRCDate = staticmethod(getSRCDate) | 367 | getSRCDate = staticmethod(getSRCDate) |
367 | 368 | ||
369 | def srcrev_internal_helper(ud, d): | ||
370 | """ | ||
371 | Return: | ||
372 | a) a source revision if specified | ||
373 | b) True if auto srcrev is in action | ||
374 | c) False otherwise | ||
375 | """ | ||
376 | |||
377 | if 'rev' in ud.parm: | ||
378 | return ud.parm['rev'] | ||
379 | |||
380 | if 'tag' in ud.parm: | ||
381 | return ud.parm['tag'] | ||
382 | |||
383 | rev = None | ||
384 | if 'name' in ud.parm: | ||
385 | pn = data.getVar("PN", d, 1) | ||
386 | rev = data.getVar("SRCREV_pn-" + pn + "_" + ud.parm['name'], d, 1) | ||
387 | if not rev: | ||
388 | rev = data.getVar("SRCREV", d, 1) | ||
389 | if not rev: | ||
390 | return False | ||
391 | if rev is "SRCREVINACTION": | ||
392 | return True | ||
393 | return rev | ||
394 | |||
395 | srcrev_internal_helper = staticmethod(srcrev_internal_helper) | ||
396 | |||
368 | def try_mirror(d, tarfn): | 397 | def try_mirror(d, tarfn): |
369 | """ | 398 | """ |
370 | Try to use a mirrored version of the sources. We do this | 399 | Try to use a mirrored version of the sources. We do this |
@@ -454,7 +483,7 @@ class Fetch(object): | |||
454 | 483 | ||
455 | pd = persist_data.PersistData(d) | 484 | pd = persist_data.PersistData(d) |
456 | key = self._revision_key(url, ud, d) | 485 | key = self._revision_key(url, ud, d) |
457 | latest_rev = self.latest_revision(url, ud, d) | 486 | latest_rev = self._build_revision(url, ud, d) |
458 | last_rev = pd.getValue("BB_URI_LOCALCOUNT", key + "_rev") | 487 | last_rev = pd.getValue("BB_URI_LOCALCOUNT", key + "_rev") |
459 | count = pd.getValue("BB_URI_LOCALCOUNT", key + "_count") | 488 | count = pd.getValue("BB_URI_LOCALCOUNT", key + "_count") |
460 | 489 | ||