1 |
Add forward-compatibility for cache entries containing md5 digests |
2 |
instead of mtimes for validation. |
3 |
|
4 |
X-Gentoo-Bug: 568934 |
5 |
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=568934 |
6 |
--- |
7 |
pym/portage/cache/sqlite.py | 9 +++++++-- |
8 |
1 file changed, 7 insertions(+), 2 deletions(-) |
9 |
|
10 |
diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py |
11 |
index 310ac94..32e4076 100644 |
12 |
--- a/pym/portage/cache/sqlite.py |
13 |
+++ b/pym/portage/cache/sqlite.py |
14 |
@@ -18,6 +18,9 @@ if sys.hexversion >= 0x3000000: |
15 |
|
16 |
class database(fs_template.FsBased): |
17 |
|
18 |
+ validation_chf = 'mtime' |
19 |
+ chf_types = ('mtime', 'md5') |
20 |
+ |
21 |
autocommits = False |
22 |
synchronous = False |
23 |
# cache_bytes is used together with page_size (set at sqlite build time) |
24 |
@@ -28,10 +31,12 @@ class database(fs_template.FsBased): |
25 |
def __init__(self, *args, **config): |
26 |
super(database, self).__init__(*args, **config) |
27 |
self._import_sqlite() |
28 |
- self._allowed_keys = ["_mtime_", "_eclasses_"] |
29 |
+ self._allowed_keys = ["_eclasses_"] |
30 |
self._allowed_keys.extend(self._known_keys) |
31 |
- self._allowed_keys.sort() |
32 |
+ self._allowed_keys.extend('_%s_' % k for k in self.chf_types) |
33 |
self._allowed_keys_set = frozenset(self._allowed_keys) |
34 |
+ self._allowed_keys = sorted(self._allowed_keys_set) |
35 |
+ |
36 |
self.location = os.path.join(self.location, |
37 |
self.label.lstrip(os.path.sep).rstrip(os.path.sep)) |
38 |
|
39 |
-- |
40 |
2.4.10 |