From b4c30ae359ee34dd8db5402bf89852ea3e5f3ad6 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 11 Aug 2007 23:11:24 +0000 Subject: [PATCH] fetch/__init__.py: Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache --- ChangeLog | 3 ++- lib/bb/fetch/__init__.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c564183..cdf25b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 fbd0ba5..f739245 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") -- 2.7.4