summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-03-21 16:28:03 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-24 22:01:24 +0000
commit12fc1c5637bca79a7a5735d9a8e819aefd0dd19b (patch)
treed3b9e4af04befcf98bb02be8cd571c32f93c15e1 /bitbake/lib/bb/fetch2
parent1f0d37436f031aceaf9561d424c342d92afd91a4 (diff)
downloadpoky-12fc1c5637bca79a7a5735d9a8e819aefd0dd19b.tar.gz
bitbake: Revert "fetch2: Allow ${AUTOREV} to be used when BB_SRCREV_POLICY is "cache""
As per mailing list discussion, the cache policy was behaving correctly before and wouldn't expect to update after the initial fetch even for AUTOREV. This reverts commit ba093a38539960e645e994a66ed7872a604c00a9. (Bitbake rev: 51f827911b7202de3e855e683fdbd732d7a84e09) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 9734e21126..d8ad19b59b 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -500,11 +500,6 @@ def fetcher_init(d):
500 srcrev_policy = d.getVar('BB_SRCREV_POLICY') or "clear" 500 srcrev_policy = d.getVar('BB_SRCREV_POLICY') or "clear"
501 if srcrev_policy == "cache": 501 if srcrev_policy == "cache":
502 logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy) 502 logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
503 # We still need to remove keys that are marked with "dontcache".
504 for key in list(revs.keys()):
505 if key.startswith("dontcache-"):
506 logger.debug(1, "Removing SRCREV key: %s" % key)
507 revs.pop(key)
508 elif srcrev_policy == "clear": 503 elif srcrev_policy == "clear":
509 logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy) 504 logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
510 revs.clear() 505 revs.clear()
@@ -737,8 +732,9 @@ def subprocess_setup():
737 signal.signal(signal.SIGPIPE, signal.SIG_DFL) 732 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
738 733
739def get_autorev(d): 734def get_autorev(d):
740 # Do not cache the srcrev in the autorev case 735 # only not cache src rev in autorev case
741 d.setVar('BB_DONT_CACHE', '1') 736 if d.getVar('BB_SRCREV_POLICY') != "cache":
737 d.setVar('BB_DONT_CACHE', '1')
742 return "AUTOINC" 738 return "AUTOINC"
743 739
744def get_srcrev(d, method_name='sortable_revision'): 740def get_srcrev(d, method_name='sortable_revision'):
@@ -1601,13 +1597,7 @@ class FetchMethod(object):
1601 return True, str(latest_rev) 1597 return True, str(latest_rev)
1602 1598
1603 def generate_revision_key(self, ud, d, name): 1599 def generate_revision_key(self, ud, d, name):
1604 key = self._revision_key(ud, d, name) 1600 return self._revision_key(ud, d, name)
1605 if d.getVar('BB_DONT_CACHE'):
1606 # Mark the key so it can be removed on the next bitbake run even if
1607 # BB_SRCREV_POLICY is "cache".
1608 return "dontcache-%s" % key
1609 else:
1610 return key
1611 1601
1612 def latest_versionstring(self, ud, d): 1602 def latest_versionstring(self, ud, d):
1613 """ 1603 """