[poky] [PATCH 8/8] Fetcher: only set __BB_DONT_CACHE when SRCREV = "${AUTOREV}"
Yu Ke
ke.yu at intel.com
Mon Dec 27 05:58:35 PST 2010
we should cache SRCREV whenever possible, the only exception is
when SREREV is auto rev. so change the logic to only set __BB_DONT_CACHE
at SRCREV = "${AUTOREV}" case
Signed-off-by: Yu Ke <ke.yu at intel.com>
---
bitbake/lib/bb/fetch/__init__.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index c710931..1a08725 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -374,6 +374,7 @@ def get_srcrev(d):
scms = []
+ autorev = False
# Only call setup_localpath on URIs which supports_srcrev()
urldata = init(bb.data.getVar('SRC_URI', d, 1).split(), d, False)
for u in urldata:
@@ -382,12 +383,14 @@ def get_srcrev(d):
if not ud.setup:
ud.setup_localpath(d)
scms.append(u)
+ if ud.autorev:
+ autorev = True
if len(scms) == 0:
bb.msg.error(bb.msg.domain.Fetcher, "SRCREV was used yet no valid SCM was found in SRC_URI")
raise ParameterError
- if bb.data.getVar('BB_SRCREV_POLICY', d, True) != "cache":
+ if bb.data.getVar('BB_SRCREV_POLICY', d, True) != "cache" and autorev:
bb.data.setVar('__BB_DONT_CACHE', '1', d)
if len(scms) == 1:
@@ -524,6 +527,7 @@ class FetchData(object):
if not self.pswd and "pswd" in self.parm:
self.pswd = self.parm["pswd"]
self.setup = False
+ self.autorev = False
if "name" in self.parm:
self.md5_name = "%s.md5sum" % self.parm["name"]
@@ -688,6 +692,7 @@ class Fetch(object):
raise InvalidSRCREV("Please set SRCREV to a valid value")
if rev == "AUTOINC":
rev = ud.method.latest_revision(ud.url, ud, d)
+ ud.autorev = True
return rev
--
1.7.0.4
More information about the poky
mailing list