diff options
-rw-r--r-- | bitbake-dev/lib/bb/fetch/__init__.py | 10 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/persist_data.py | 10 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 10 | ||||
-rw-r--r-- | bitbake/lib/bb/persist_data.py | 10 |
4 files changed, 14 insertions, 26 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): methods = [] urldata_cache = {} +saved_headrevs = {} def fetcher_init(d): """ @@ -91,12 +92,15 @@ def fetcher_init(d): 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.renameDomain("BB_URI_HEADREVS", "BB_URI_HEADREVS_PREVIOUS") + try: + bb.fetch.saved_headrevs = pd.getKeyValues("BB_URI_HEADREVS") + except: + pass + 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_HEADREVS_PREVIOUS") pd.addDomain("BB_URI_LOCALCOUNT") def fetcher_compare_revisons(d): @@ -107,7 +111,7 @@ def fetcher_compare_revisons(d): pd = persist_data.PersistData(d) data = pd.getKeyValues("BB_URI_HEADREVS") - data2 = pd.getKeyValues("BB_URI_HEADREVS_PREVIOUS") + data2 = bb.fetch.saved_headrevs changed = False 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: """ self.connection.execute("DROP TABLE IF EXISTS %s;" % domain) - - def renameDomain(self, domain, newdomain): - """ - Renames a domain, removing the target if it already exists - """ - - self.connection.execute("DROP TABLE IF EXISTS %s;" % newdomain) - self.addDomain(domain) - self.connection.execute("ALTER TABLE %s RENAME TO %s;" % (domain, newdomain)) - def getKeyValues(self, domain): """ Return a list of key + value pairs for a domain diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index a97138d271..368e9e78c1 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py @@ -84,6 +84,7 @@ def uri_replace(uri, uri_find, uri_replace, d): methods = [] urldata_cache = {} +saved_headrevs = {} def fetcher_init(d): """ @@ -97,12 +98,15 @@ def fetcher_init(d): 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.renameDomain("BB_URI_HEADREVS", "BB_URI_HEADREVS_PREVIOUS") + try: + bb.fetch.saved_headrevs = pd.getKeyValues("BB_URI_HEADREVS") + except: + pass + 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_HEADREVS_PREVIOUS") pd.addDomain("BB_URI_LOCALCOUNT") def fetcher_compare_revisons(d): @@ -113,7 +117,7 @@ def fetcher_compare_revisons(d): pd = persist_data.PersistData(d) data = pd.getKeyValues("BB_URI_HEADREVS") - data2 = pd.getKeyValues("BB_URI_HEADREVS_PREVIOUS") + data2 = bb.fetch.saved_headrevs changed = False for key in data: diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py index 1d60a0a139..bc4045fe85 100644 --- a/bitbake/lib/bb/persist_data.py +++ b/bitbake/lib/bb/persist_data.py @@ -69,16 +69,6 @@ class PersistData: """ self.connection.execute("DROP TABLE IF EXISTS %s;" % domain) - - def renameDomain(self, domain, newdomain): - """ - Renames a domain, removing the target if it already exists - """ - - self.connection.execute("DROP TABLE IF EXISTS %s;" % newdomain) - self.addDomain(domain) - self.connection.execute("ALTER TABLE %s RENAME TO %s;" % (domain, newdomain)) - def getKeyValues(self, domain): """ Return a list of key + value pairs for a domain |