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): | |||
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 |
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): | |||
84 | 84 | ||
85 | methods = [] | 85 | methods = [] |
86 | urldata_cache = {} | 86 | urldata_cache = {} |
87 | saved_headrevs = {} | ||
87 | 88 | ||
88 | def fetcher_init(d): | 89 | def fetcher_init(d): |
89 | """ | 90 | """ |
@@ -97,12 +98,15 @@ def fetcher_init(d): | |||
97 | bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy) | 98 | bb.msg.debug(1, bb.msg.domain.Fetcher, "Keeping SRCREV cache due to cache policy of: %s" % srcrev_policy) |
98 | elif srcrev_policy == "clear": | 99 | elif srcrev_policy == "clear": |
99 | bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy) | 100 | bb.msg.debug(1, bb.msg.domain.Fetcher, "Clearing SRCREV cache due to cache policy of: %s" % srcrev_policy) |
100 | pd.renameDomain("BB_URI_HEADREVS", "BB_URI_HEADREVS_PREVIOUS") | 101 | try: |
102 | bb.fetch.saved_headrevs = pd.getKeyValues("BB_URI_HEADREVS") | ||
103 | except: | ||
104 | pass | ||
105 | pd.delDomain("BB_URI_HEADREVS") | ||
101 | else: | 106 | else: |
102 | bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy) | 107 | bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy) |
103 | # Make sure our domains exist | 108 | # Make sure our domains exist |
104 | pd.addDomain("BB_URI_HEADREVS") | 109 | pd.addDomain("BB_URI_HEADREVS") |
105 | pd.addDomain("BB_URI_HEADREVS_PREVIOUS") | ||
106 | pd.addDomain("BB_URI_LOCALCOUNT") | 110 | pd.addDomain("BB_URI_LOCALCOUNT") |
107 | 111 | ||
108 | def fetcher_compare_revisons(d): | 112 | def fetcher_compare_revisons(d): |
@@ -113,7 +117,7 @@ def fetcher_compare_revisons(d): | |||
113 | 117 | ||
114 | pd = persist_data.PersistData(d) | 118 | pd = persist_data.PersistData(d) |
115 | data = pd.getKeyValues("BB_URI_HEADREVS") | 119 | data = pd.getKeyValues("BB_URI_HEADREVS") |
116 | data2 = pd.getKeyValues("BB_URI_HEADREVS_PREVIOUS") | 120 | data2 = bb.fetch.saved_headrevs |
117 | 121 | ||
118 | changed = False | 122 | changed = False |
119 | for key in data: | 123 | 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: | |||
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 |