Lines 3-9
Link Here
|
3 |
# License: GPL2 |
3 |
# License: GPL2 |
4 |
# $Id$ |
4 |
# $Id$ |
5 |
|
5 |
|
6 |
import cache_errors |
6 |
if not hasattr(__builtins__, "set"): |
|
|
7 |
from sets import Set as set |
8 |
from itertools import chain |
9 |
from cache import cache_errors |
7 |
|
10 |
|
8 |
def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, verbose_instance=None): |
11 |
def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, verbose_instance=None): |
9 |
|
12 |
|
Lines 33-38
Link Here
|
33 |
del e |
36 |
del e |
34 |
continue |
37 |
continue |
35 |
write_it = True |
38 |
write_it = True |
|
|
39 |
trg = None |
36 |
try: |
40 |
try: |
37 |
trg = trg_cache[x] |
41 |
trg = trg_cache[x] |
38 |
if long(trg["_mtime_"]) == long(entry["_mtime_"]) and eclass_cache.is_eclass_data_valid(trg["_eclasses_"]): |
42 |
if long(trg["_mtime_"]) == long(entry["_mtime_"]) and eclass_cache.is_eclass_data_valid(trg["_eclasses_"]): |
Lines 40-45
Link Here
|
40 |
except (cache_errors.CacheError, KeyError): |
44 |
except (cache_errors.CacheError, KeyError): |
41 |
pass |
45 |
pass |
42 |
|
46 |
|
|
|
47 |
if trg and not write_it: |
48 |
""" We don't want to skip the write unless we're really sure that |
49 |
the existing cache is identical, so don't trust _mtime_ and |
50 |
_eclasses_ alone.""" |
51 |
for d in (entry, trg): |
52 |
if "EAPI" in d and d["EAPI"] in ("", "0"): |
53 |
del d["EAPI"] |
54 |
for k in set(chain(entry, trg)).difference( |
55 |
("_mtime_", "_eclasses_")): |
56 |
if trg.get(k, "") != entry.get(k, ""): |
57 |
write_it = True |
58 |
break |
59 |
|
43 |
if write_it: |
60 |
if write_it: |
44 |
try: |
61 |
try: |
45 |
inherited = entry.get("INHERITED", None) |
62 |
inherited = entry.get("INHERITED", None) |