diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-11 23:11:24 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-11 23:11:24 +0000 |
commit | b4c30ae359ee34dd8db5402bf89852ea3e5f3ad6 (patch) | |
tree | e439aa30ba6dcd89cb072ec70590f7ba1a3c44a1 | |
parent | 37c8e3b3bbf7ac0c52714adc56727908ec4dc1cc (diff) | |
download | bitbake-b4c30ae359ee34dd8db5402bf89852ea3e5f3ad6.tar.gz |
fetch/__init__.py: Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | lib/bb/fetch/__init__.py | 11 |
2 files changed, 11 insertions, 3 deletions
@@ -12,7 +12,8 @@ Changes in Bitbake 1.8.x: - Add pn-PN to overrides when evaluating PREFERRED_VERSION - Improve the progress indicator by skipping tasks that have already run before starting the build rather than during it - - Add profiling option (-P) + - Add profiling option (-P) + - Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache Changes in Bitbake 1.8.6: - Correctly redirect stdin when forking diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index fbd0ba594..f739245bd 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -88,8 +88,15 @@ def fetcher_init(d): Calls before this must not hit the cache. """ pd = persist_data.PersistData(d) - # When to drop SCM head revisions should be controled by user policy - pd.delDomain("BB_URI_HEADREVS") + # When to drop SCM head revisions controled by user policy + srcrev_policy = bb.data.getVar('BB_SRCREV_POLICY', d, 1) or "clear" + if srcrev_policy == "cache": + 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") + 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_LOCALCOUNT") |