summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
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/lib/bb
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/lib/bb')
-rw-r--r--bitbake/lib/bb/cooker.py3
-rw-r--r--bitbake/lib/bb/fetch/__init__.py23
2 files changed, 25 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 1f31d1203a..b0692431bb 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -612,6 +612,9 @@ class BBCooker:
612 # initialise the parsing status now we know we will need deps 612 # initialise the parsing status now we know we will need deps
613 self.updateCache() 613 self.updateCache()
614 614
615 if self.configuration.revisions_changed:
616 sys.exit(bb.fetch.fetcher_compare_revisons(self.configuration.data))
617
615 if self.configuration.parse_only: 618 if self.configuration.parse_only:
616 bb.msg.note(1, bb.msg.domain.Collection, "Requested parsing .bb files only. Exiting.") 619 bb.msg.note(1, bb.msg.domain.Collection, "Requested parsing .bb files only. Exiting.")
617 return 0 620 return 0
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 39a8180a89..a97138d271 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -97,13 +97,34 @@ def fetcher_init(d):
97 bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy) 97 bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy)
98 elif srcrev_policy == "clear": 98 elif srcrev_policy == "clear":
99 bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy) 99 bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy)
100 pd.delDomain("BB_URI_HEADREVS") 100 pd.renameDomain("BB_URI_HEADREVS", "BB_URI_HEADREVS_PREVIOUS")
101 else: 101 else:
102 bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy) 102 bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy)
103 # Make sure our domains exist 103 # Make sure our domains exist
104 pd.addDomain("BB_URI_HEADREVS") 104 pd.addDomain("BB_URI_HEADREVS")
105 pd.addDomain("BB_URI_HEADREVS_PREVIOUS")
105 pd.addDomain("BB_URI_LOCALCOUNT") 106 pd.addDomain("BB_URI_LOCALCOUNT")
106 107
108def fetcher_compare_revisons(d):
109 """
110 Compare the revisions in the persistant cache with current values and
111 return true/false on whether they've changed.
112 """
113
114 pd = persist_data.PersistData(d)
115 data = pd.getKeyValues("BB_URI_HEADREVS")
116 data2 = pd.getKeyValues("BB_URI_HEADREVS_PREVIOUS")
117
118 changed = False
119 for key in data:
120 if key not in data2 or data2[key] != data[key]:
121 bb.msg.debug(1, bb.msg.domain.Fetcher, "%s changed" % key)
122 changed = True
123 return True
124 else:
125 bb.msg.debug(2, bb.msg.domain.Fetcher, "%s did not change" % key)
126 return False
127
107# Function call order is usually: 128# Function call order is usually:
108# 1. init 129# 1. init
109# 2. go 130# 2. go