diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-30 21:24:31 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-30 21:24:31 +0100 |
commit | 433c2d2318dc32843fb1f92487977d2152b72818 (patch) | |
tree | 5abf3379d4b43e9e74b2a3001428ab8c7d71e068 /bitbake-dev | |
parent | ef9c095334632b8576667800d52b842f1cbf52ea (diff) | |
download | poky-433c2d2318dc32843fb1f92487977d2152b72818.tar.gz |
bitbake: Remove persist_data domain renaming code as it appears to expose sqlite bugs and data consistency issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake-dev')
-rw-r--r-- | bitbake-dev/lib/bb/fetch/__init__.py | 10 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/persist_data.py | 10 |
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 | ||
79 | methods = [] | 79 | methods = [] |
80 | urldata_cache = {} | 80 | urldata_cache = {} |
81 | saved_headrevs = {} | ||
81 | 82 | ||
82 | def fetcher_init(d): | 83 | def 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 | ||
102 | def fetcher_compare_revisons(d): | 106 | def 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 |