summaryrefslogtreecommitdiffstats
path: root/bitbake-dev/lib/bb/fetch/__init__.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-07-29 14:33:14 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-07-29 14:33:14 +0100
commit64b04685b6fd029f2f70f7017bfd51d26ccb0d11 (patch)
tree5d525e2b58e5a9b27ea3096a0047770446baaf29 /bitbake-dev/lib/bb/fetch/__init__.py
parent231b5f67844da39949e04ae53557cea04aacffdd (diff)
downloadpoky-64b04685b6fd029f2f70f7017bfd51d26ccb0d11.tar.gz
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/__init__.py')
-rw-r--r--bitbake-dev/lib/bb/fetch/__init__.py23
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):
91 bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy) 91 bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy)
92 elif srcrev_policy == "clear": 92 elif srcrev_policy == "clear":
93 bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy) 93 bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy)
94 pd.delDomain("BB_URI_HEADREVS") 94 pd.renameDomain("BB_URI_HEADREVS", "BB_URI_HEADREVS_PREVIOUS")
95 else: 95 else:
96 bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy) 96 bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy)
97 # Make sure our domains exist 97 # Make sure our domains exist
98 pd.addDomain("BB_URI_HEADREVS") 98 pd.addDomain("BB_URI_HEADREVS")
99 pd.addDomain("BB_URI_HEADREVS_PREVIOUS")
99 pd.addDomain("BB_URI_LOCALCOUNT") 100 pd.addDomain("BB_URI_LOCALCOUNT")
100 101
102def fetcher_compare_revisons(d):
103 """
104 Compare the revisions in the persistant cache with current values and
105 return true/false on whether they've changed.
106 """
107
108 pd = persist_data.PersistData(d)
109 data = pd.getKeyValues("BB_URI_HEADREVS")
110 data2 = pd.getKeyValues("BB_URI_HEADREVS_PREVIOUS")
111
112 changed = False
113 for key in data:
114 if key not in data2 or data2[key] != data[key]:
115 bb.msg.debug(1, bb.msg.domain.Fetcher, "%s changed" % key)
116 changed = True
117 return True
118 else:
119 bb.msg.debug(2, bb.msg.domain.Fetcher, "%s did not change" % key)
120 return False
121
101# Function call order is usually: 122# Function call order is usually:
102# 1. init 123# 1. init
103# 2. go 124# 2. go