Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: man/, pym/portage/tests/dbapi/, pym/portage/repository/
Date: Tue, 27 Nov 2012 15:46:19
Message-Id: 1354031153.e760c8d2a4ccc56e351ac37904c715f596b58e42.zmedico@gentoo
1 commit: e760c8d2a4ccc56e351ac37904c715f596b58e42
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 27 15:45:53 2012 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 27 15:45:53 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e760c8d2
7
8 egencache: enable md5-dict format by default
9
10 WARNING: Portage versions prior to portage-2.1.11.14 will NOT
11 recognize the 'md5-dict' format unless it is explicitly listed
12 in metadata/layout.conf (refer to portage(5) for example usage).
13
14 WARNING: For backward compatibility, the obsolete 'pms' cache
15 format will still be generated by default if the metadata/cache/
16 directory exists in the repository.
17
18 ---
19 man/egencache.1 | 28 +++++++++++++++++--------
20 pym/portage/repository/config.py | 13 +++++++++--
21 pym/portage/tests/dbapi/test_portdb_cache.py | 8 +++---
22 3 files changed, 33 insertions(+), 16 deletions(-)
23
24 diff --git a/man/egencache.1 b/man/egencache.1
25 index bc5db67..57a509d 100644
26 --- a/man/egencache.1
27 +++ b/man/egencache.1
28 @@ -108,10 +108,10 @@ contains will be added to the beginning of the command line on every
29 invocation. These options will not be added if the
30 \fB\-\-ignore-default\-opts\fR option is specified.
31 .SH "BUGS"
32 -There are significant limitations associated with the metadata
33 -cache format that is distributed in the \fImetadata/cache/\fR directory
34 -of the repository. These limitations are related to the cache validation
35 -mechanism. Currently, the validation mechanism involves comparison of
36 +Prior to portage-2.1.11.32, the 'pms' cache format was enabled by default.
37 +This 'pms' format, which is distributed in the \fImetadata/cache/\fR
38 +directory of the repository, has significant limitations related to the
39 +cache validation mechanism which involves comparison of
40 a cache entry mtime to the mtime of the corresponding \fBebuild(5)\fR. This
41 mechanism is unreliable in cases when eclass changes result in metadata
42 changes, since no information about eclass state is available in the cache.
43 @@ -123,11 +123,21 @@ implemented in \fBemerge\fR(1) \fB\-\-sync\fR which updates ebuild mtimes
44 to match their corresponding cache entries (except for ebuilds that are
45 modified relative to HEAD).
46
47 -In order to solve the above problems, a future extension
48 -to the cache format will include additional
49 -validation data in the form of digests for both the ebuild
50 -and its inherited eclasses. Until the
51 -cache format has been extended in this way, it is necessary to enable
52 +In order to solve the above problems, the newer 'md5-dict' format has been
53 +enabled by default since portage-2.1.11.32. This format is distributed in
54 +the \fImetadata/md5-cache/\fR directory of the repository, and includes
55 +additional validation data in the form of digests for both the ebuild
56 +and its inherited eclasses. \fBWARNING:\fR Portage versions prior to
57 +portage-2.1.11.14 will \fBNOT\fR recognize the 'md5-dict' format unless it is
58 +explicitly listed in \fImetadata/layout.conf\fR (refer to \fBportage\fR(5)
59 +for example usage).
60 +
61 +\fBWARNING:\fR For backward compatibility, the obsolete 'pms' cache format
62 +will still be generated by default if the \fImetadata/cache/\fR directory
63 +exists in the repository. It can also be explicitly enabled via the
64 +cache\-formats setting in \fImetadata/layout.conf\fR (refer to \fBportage\fR(5)
65 +for example usage). If the 'pms' cache format is enabled and the 'md5-dict'
66 +format is not enabled, then it is necessary to enable
67 \fBmetadata-transfer\fR in \fBFEATURES\fR (see \fBmake.conf(5)\fR).
68 This causes intermediate cache (in a different format that includes
69 eclass state) to be generated inside the directory which is configurable
70
71 diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
72 index 71f548c..246be0e 100644
73 --- a/pym/portage/repository/config.py
74 +++ b/pym/portage/repository/config.py
75 @@ -200,7 +200,11 @@ class RepoConfig(object):
76 if not formats:
77 if not force:
78 return
79 - formats = ('pms',)
80 + # The default egencache format was 'pms' prior to portage-2.1.11.32
81 + # (portage versions ersions prior to portage-2.1.11.14 will NOT
82 + # recognize md5-dict format unless it is explicitly listed in
83 + # layout.conf).
84 + formats = ('md5-dict',)
85
86 for fmt in formats:
87 name = None
88 @@ -739,8 +743,11 @@ def parse_layout_conf(repo_location, repo_name=None):
89 cache_formats = layout_data.get('cache-formats', '').lower().split()
90 if not cache_formats:
91 # Auto-detect cache formats, and prefer md5-cache if available.
92 - # After this behavior is deployed in stable portage, the default
93 - # egencache format can be changed to md5-dict.
94 + # This behavior was deployed in portage-2.1.11.14, so that the
95 + # default egencache format could eventually be changed to md5-dict
96 + # in portage-2.1.11.32. WARNING: Versions prior to portage-2.1.11.14
97 + # will NOT recognize md5-dict format unless it is explicitly
98 + # listed in layout.conf.
99 cache_formats = []
100 if os.path.isdir(os.path.join(repo_location, 'metadata', 'md5-cache')):
101 cache_formats.append('md5-dict')
102
103 diff --git a/pym/portage/tests/dbapi/test_portdb_cache.py b/pym/portage/tests/dbapi/test_portdb_cache.py
104 index 6526246..3290d08 100644
105 --- a/pym/portage/tests/dbapi/test_portdb_cache.py
106 +++ b/pym/portage/tests/dbapi/test_portdb_cache.py
107 @@ -51,8 +51,8 @@ class PortdbCacheTestCase(TestCase):
108 """),),
109
110 egencache_cmd + ("--update",),
111 - (lambda: os.path.exists(pms_cache_dir),),
112 - (lambda: not os.path.exists(md5_cache_dir),),
113 + (lambda: not os.path.exists(pms_cache_dir),),
114 + (lambda: os.path.exists(md5_cache_dir),),
115 python_cmd + (textwrap.dedent("""
116 import os, sys, portage
117 if portage.portdb.porttree_root not in portage.portdb._pregen_auxdb:
118 @@ -60,8 +60,8 @@ class PortdbCacheTestCase(TestCase):
119 """),),
120 python_cmd + (textwrap.dedent("""
121 import os, sys, portage
122 - from portage.cache.metadata import database as pms_database
123 - if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.porttree_root], pms_database):
124 + from portage.cache.flat_hash import md5_database
125 + if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.porttree_root], md5_database):
126 sys.exit(1)
127 """),),