diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-29 14:33:14 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-29 14:33:14 +0100 |
commit | 64b04685b6fd029f2f70f7017bfd51d26ccb0d11 (patch) | |
tree | 5d525e2b58e5a9b27ea3096a0047770446baaf29 /bitbake-dev/lib/bb/fetch | |
parent | 231b5f67844da39949e04ae53557cea04aacffdd (diff) | |
download | openembedded-core-64b04685b6fd029f2f70f7017bfd51d26ccb0d11.tar.gz openembedded-core-64b04685b6fd029f2f70f7017bfd51d26ccb0d11.tar.bz2 openembedded-core-64b04685b6fd029f2f70f7017bfd51d26ccb0d11.zip |
bitbake: Add a --revisions-changed commandline option to indicate when floating srcrevs have changed
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake-dev/lib/bb/fetch')
-rw-r--r-- | bitbake-dev/lib/bb/fetch/__init__.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/bitbake-dev/lib/bb/fetch/__init__.py b/bitbake-dev/lib/bb/fetch/__init__.py index 39a577b2eb..8ddcd38706 100644 --- a/bitbake-dev/lib/bb/fetch/__init__.py +++ b/bitbake-dev/lib/bb/fetch/__init__.py @@ -91,13 +91,34 @@ def fetcher_init(d): bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy) elif srcrev_policy == "clear": bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy) - pd.delDomain("BB_URI_HEADREVS") + pd.renameDomain("BB_URI_HEADREVS", "BB_URI_HEADREVS_PREVIOUS") else: bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy) # Make sure our domains exist pd.addDomain("BB_URI_HEADREVS") + pd.addDomain("BB_URI_HEADREVS_PREVIOUS") pd.addDomain("BB_URI_LOCALCOUNT") +def fetcher_compare_revisons(d): + """ + Compare the revisions in the persistant cache with current values and + return true/false on whether they've changed. + """ + + pd = persist_data.PersistData(d) + data = pd.getKeyValues("BB_URI_HEADREVS") + data2 = pd.getKeyValues("BB_URI_HEADREVS_PREVIOUS") + + changed = False + for key in data: + if key not in data2 or data2[key] != data[key]: + bb.msg.debug(1, bb.msg.domain.Fetcher, "%s changed" % key) + changed = True + return True + else: + bb.msg.debug(2, bb.msg.domain.Fetcher, "%s did not change" % key) + return False + # Function call order is usually: # 1. init # 2. go |