summaryrefslogtreecommitdiffstats
path: root/bitbake-dev
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake-dev')
-rw-r--r--bitbake-dev/lib/bb/fetch/__init__.py10
-rw-r--r--bitbake-dev/lib/bb/persist_data.py10
2 files changed, 7 insertions, 13 deletions
diff --git a/bitbake-dev/lib/bb/fetch/__init__.py b/bitbake-dev/lib/bb/fetch/__init__.py
index 8ddcd38706..cd7e59a558 100644
--- a/bitbake-dev/lib/bb/fetch/__init__.py
+++ b/bitbake-dev/lib/bb/fetch/__init__.py
@@ -78,6 +78,7 @@ def uri_replace(uri, uri_find, uri_replace, d):
78 78
79methods = [] 79methods = []
80urldata_cache = {} 80urldata_cache = {}
81saved_headrevs = {}
81 82
82def fetcher_init(d): 83def fetcher_init(d):
83 """ 84 """
@@ -91,12 +92,15 @@ def fetcher_init(d):
91 bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy) 92 bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy)
92 elif srcrev_policy == "clear": 93 elif srcrev_policy == "clear":
93 bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy) 94 bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy)
94 pd.renameDomain("BB_URI_HEADREVS", "BB_URI_HEADREVS_PREVIOUS") 95 try:
96 bb.fetch.saved_headrevs = pd.getKeyValues("BB_URI_HEADREVS")
97 except:
98 pass
99 pd.delDomain("BB_URI_HEADREVS")
95 else: 100 else:
96 bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy) 101 bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy)
97 # Make sure our domains exist 102 # Make sure our domains exist
98 pd.addDomain("BB_URI_HEADREVS") 103 pd.addDomain("BB_URI_HEADREVS")
99 pd.addDomain("BB_URI_HEADREVS_PREVIOUS")
100 pd.addDomain("BB_URI_LOCALCOUNT") 104 pd.addDomain("BB_URI_LOCALCOUNT")
101 105
102def fetcher_compare_revisons(d): 106def fetcher_compare_revisons(d):
@@ -107,7 +111,7 @@ def fetcher_compare_revisons(d):
107 111
108 pd = persist_data.PersistData(d) 112 pd = persist_data.PersistData(d)
109 data = pd.getKeyValues("BB_URI_HEADREVS") 113 data = pd.getKeyValues("BB_URI_HEADREVS")
110 data2 = pd.getKeyValues("BB_URI_HEADREVS_PREVIOUS") 114 data2 = bb.fetch.saved_headrevs
111 115
112 changed = False 116 changed = False
113 for key in data: 117 for key in data:
diff --git a/bitbake-dev/lib/bb/persist_data.py b/bitbake-dev/lib/bb/persist_data.py
index 1d60a0a139..bc4045fe85 100644
--- a/bitbake-dev/lib/bb/persist_data.py
+++ b/bitbake-dev/lib/bb/persist_data.py
@@ -69,16 +69,6 @@ class PersistData:
69 """ 69 """
70 self.connection.execute("DROP TABLE IF EXISTS %s;" % domain) 70 self.connection.execute("DROP TABLE IF EXISTS %s;" % domain)
71 71
72
73 def renameDomain(self, domain, newdomain):
74 """
75 Renames a domain, removing the target if it already exists
76 """
77
78 self.connection.execute("DROP TABLE IF EXISTS %s;" % newdomain)
79 self.addDomain(domain)
80 self.connection.execute("ALTER TABLE %s RENAME TO %s;" % (domain, newdomain))
81
82 def getKeyValues(self, domain): 72 def getKeyValues(self, domain):
83 """ 73 """
84 Return a list of key + value pairs for a domain 74 Return a list of key + value pairs for a domain