[oe-commits] [bitbake] 02/08: fetch2: Make fetcher_compare_revisions() work
git at git.openembedded.org
git at git.openembedded.org
Wed Feb 19 11:26:43 UTC 2020
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master
in repository bitbake.
commit ffd663a8e07e2e39e8ca2d2493f4f98037c5f9e4
Author: Peter Kjellerstedt <pkj at axis.com>
AuthorDate: Sat Feb 15 04:29:54 2020 +0100
fetch2: Make fetcher_compare_revisions() work
This seems to have been broken for a very long time. Now it also works
regardless of BB_SRCREV_POLICY.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/fetch2/__init__.py | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 1b7f573..5646276 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -485,17 +485,22 @@ def fetcher_init(d):
Called to initialize the fetchers once the configuration data is known.
Calls before this must not hit the cache.
"""
+
+ revs = bb.persist_data.persist('BB_URI_HEADREVS', d)
+ try:
+ # fetcher_init is called multiple times, so make sure we only save the
+ # revs the first time it is called.
+ if not bb.fetch2.saved_headrevs:
+ bb.fetch2.saved_headrevs = dict(revs)
+ except:
+ pass
+
# When to drop SCM head revisions controlled by user policy
srcrev_policy = d.getVar('BB_SRCREV_POLICY') or "clear"
if srcrev_policy == "cache":
logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
elif srcrev_policy == "clear":
logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
- revs = bb.persist_data.persist('BB_URI_HEADREVS', d)
- try:
- bb.fetch2.saved_headrevs = revs.items()
- except:
- pass
revs.clear()
else:
raise FetchError("Invalid SRCREV cache policy of: %s" % srcrev_policy)
@@ -514,22 +519,12 @@ def fetcher_parse_done():
def fetcher_compare_revisions(d):
"""
- Compare the revisions in the persistant cache with current values and
- return true/false on whether they've changed.
+ Compare the revisions in the persistent cache with the saved values from
+ when bitbake was started and return true if they have changed.
"""
- data = bb.persist_data.persist('BB_URI_HEADREVS', d).items()
- data2 = bb.fetch2.saved_headrevs
-
- changed = False
- for key in data:
- if key not in data2 or data2[key] != data[key]:
- logger.debug(1, "%s changed", key)
- changed = True
- return True
- else:
- logger.debug(2, "%s did not change", key)
- return False
+ headrevs = dict(bb.persist_data.persist('BB_URI_HEADREVS', d))
+ return headrevs != bb.fetch2.saved_headrevs
def mirror_from_string(data):
mirrors = (data or "").replace('\\n',' ').split()
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list