Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15433 - in main/branches/prefix: bin man pym/_emerge pym/portage pym/repoman
Date: Mon, 22 Feb 2010 13:02:29
Message-Id: E1NjXvb-0002MB-Dr@stork.gentoo.org
1 Author: grobian
2 Date: 2010-02-22 13:02:22 +0000 (Mon, 22 Feb 2010)
3 New Revision: 15433
4
5 Added:
6 main/branches/prefix/pym/portage/util/
7 Modified:
8 main/branches/prefix/bin/repoman
9 main/branches/prefix/man/repoman.1
10 main/branches/prefix/pym/_emerge/FakeVartree.py
11 main/branches/prefix/pym/_emerge/PackageVirtualDbapi.py
12 main/branches/prefix/pym/_emerge/depgraph.py
13 main/branches/prefix/pym/portage/__init__.py
14 main/branches/prefix/pym/portage/glsa.py
15 main/branches/prefix/pym/repoman/checks.py
16 Log:
17 Merged from trunk -r15417:15421
18
19 | 15418 | Bug #299095 - Add a deprecation warning for check_license |
20 | zmedico | calls with EAPI >= 3 since it is superceded by LICENSE |
21 | | masking. |
22
23 | 15419 | Use lazy import for the portage.dbapi module. |
24 | zmedico | |
25
26 | 15420 | Don't import the portage.dbapi.dbapi class as portage.dbapi |
27 | zmedico | anymore, since it results in a strange namespace collision |
28 | | (portage.dbapi is both a class and a module). Hopefully this |
29 | | won't break any api consumers since it's a pure virtual |
30 | | class anyway. |
31
32 | 15421 | Create a directory for splitting the portage.util module |
33 | zmedico | into smaller files. |
34
35
36 Modified: main/branches/prefix/bin/repoman
37 ===================================================================
38 --- main/branches/prefix/bin/repoman 2010-02-22 13:01:13 UTC (rev 15432)
39 +++ main/branches/prefix/bin/repoman 2010-02-22 13:02:22 UTC (rev 15433)
40 @@ -286,6 +286,7 @@
41 "DESCRIPTION.missing":"Ebuilds that have a missing or empty DESCRIPTION variable",
42 "DESCRIPTION.toolong":"DESCRIPTION is over %d characters" % max_desc_len,
43 "EAPI.definition":"EAPI is defined after an inherit call (must be defined before)",
44 + "EAPI.deprecated":"Ebuilds that use features that are deprecated in the current EAPI",
45 "EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI",
46 "EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
47 "SLOT.invalid":"Ebuilds that have a missing or invalid SLOT variable value",
48 @@ -367,6 +368,7 @@
49 "DEPEND.badmaskedindev","RDEPEND.badmaskedindev","PDEPEND.badmaskedindev",
50 "DEPEND.badtilde", "RDEPEND.badtilde", "PDEPEND.badtilde",
51 "DESCRIPTION.toolong",
52 +"EAPI.deprecated",
53 "HOMEPAGE.virtual",
54 "LICENSE.virtual",
55 "KEYWORDS.dropped",
56
57 Modified: main/branches/prefix/man/repoman.1
58 ===================================================================
59 --- main/branches/prefix/man/repoman.1 2010-02-22 13:01:13 UTC (rev 15432)
60 +++ main/branches/prefix/man/repoman.1 2010-02-22 13:02:22 UTC (rev 15433)
61 @@ -110,6 +110,9 @@
62 .B EAPI.definition
63 EAPI is defined after an inherit call (must be defined before)
64 .TP
65 +.B EAPI.deprecated
66 +Ebuilds that use features that are deprecated in the current EAPI
67 +.TP
68 .B EAPI.incompatible
69 Ebuilds that use features that are only available with a different EAPI
70 .TP
71
72 Modified: main/branches/prefix/pym/_emerge/FakeVartree.py
73 ===================================================================
74 --- main/branches/prefix/pym/_emerge/FakeVartree.py 2010-02-22 13:01:13 UTC (rev 15432)
75 +++ main/branches/prefix/pym/_emerge/FakeVartree.py 2010-02-22 13:02:22 UTC (rev 15433)
76 @@ -8,11 +8,12 @@
77 from portage import os
78 from _emerge.Package import Package
79 from _emerge.PackageVirtualDbapi import PackageVirtualDbapi
80 +from portage.dbapi.vartree import vartree
81
82 if sys.hexversion >= 0x3000000:
83 long = int
84
85 -class FakeVartree(portage.vartree):
86 +class FakeVartree(vartree):
87 """This is implements an in-memory copy of a vartree instance that provides
88 all the interfaces required for use by the depgraph. The vardb is locked
89 during the constructor call just long enough to read a copy of the
90
91 Modified: main/branches/prefix/pym/_emerge/PackageVirtualDbapi.py
92 ===================================================================
93 --- main/branches/prefix/pym/_emerge/PackageVirtualDbapi.py 2010-02-22 13:01:13 UTC (rev 15432)
94 +++ main/branches/prefix/pym/_emerge/PackageVirtualDbapi.py 2010-02-22 13:02:22 UTC (rev 15433)
95 @@ -3,9 +3,9 @@
96 # $Id$
97
98 import sys
99 -import portage
100 +from portage.dbapi import dbapi
101
102 -class PackageVirtualDbapi(portage.dbapi):
103 +class PackageVirtualDbapi(dbapi):
104 """
105 A dbapi-like interface class that represents the state of the installed
106 package database as new packages are installed, replacing any packages
107 @@ -14,7 +14,7 @@
108 internally (passed in via cpv_inject() and cpv_remove() calls).
109 """
110 def __init__(self, settings):
111 - portage.dbapi.__init__(self)
112 + dbapi.__init__(self)
113 self.settings = settings
114 self._match_cache = {}
115 self._cp_map = {}
116 @@ -80,7 +80,7 @@
117 result = self._match_cache.get(origdep)
118 if result is not None:
119 return result[:]
120 - result = portage.dbapi.match(self, origdep, use_cache=use_cache)
121 + result = dbapi.match(self, origdep, use_cache=use_cache)
122 self._match_cache[origdep] = result
123 return result[:]
124
125
126 Modified: main/branches/prefix/pym/_emerge/depgraph.py
127 ===================================================================
128 --- main/branches/prefix/pym/_emerge/depgraph.py 2010-02-22 13:01:13 UTC (rev 15432)
129 +++ main/branches/prefix/pym/_emerge/depgraph.py 2010-02-22 13:02:22 UTC (rev 15433)
130 @@ -14,6 +14,7 @@
131 import portage
132 from portage import os
133 from portage import digraph
134 +from portage.dbapi import dbapi
135 from portage.dep import Atom
136 from portage.output import bold, blue, colorize, create_color_func, darkblue, \
137 darkgreen, green, nc_len, red, teal, turquoise, yellow
138 @@ -5236,7 +5237,7 @@
139 def get_runtime_pkg_mask(self):
140 return self._dynamic_config._runtime_pkg_mask.copy()
141
142 -class _dep_check_composite_db(portage.dbapi):
143 +class _dep_check_composite_db(dbapi):
144 """
145 A dbapi-like interface that is optimized for use in dep_check() calls.
146 This is built on top of the existing depgraph package selection logic.
147 @@ -5245,7 +5246,7 @@
148 via dep_check().
149 """
150 def __init__(self, depgraph, root):
151 - portage.dbapi.__init__(self)
152 + dbapi.__init__(self)
153 self._depgraph = depgraph
154 self._root = root
155 self._match_cache = {}
156
157 Modified: main/branches/prefix/pym/portage/__init__.py
158 ===================================================================
159 --- main/branches/prefix/pym/portage/__init__.py 2010-02-22 13:01:13 UTC (rev 15432)
160 +++ main/branches/prefix/pym/portage/__init__.py 2010-02-22 13:02:22 UTC (rev 15433)
161 @@ -83,6 +83,12 @@
162 'portage.data',
163 'portage.data:lchown,ostype,portage_gid,portage_uid,secpass,' + \
164 'uid,userland,userpriv_groups,wheelgid',
165 + 'portage.dbapi',
166 + 'portage.dbapi.bintree:bindbapi,binarytree',
167 + 'portage.dbapi.porttree:close_portdbapi_caches,FetchlistDict,' + \
168 + 'portagetree,portdbapi',
169 + 'portage.dbapi.vartree:vardbapi,vartree,dblink',
170 + 'portage.dbapi.virtual:fakedbapi',
171 'portage.dep',
172 'portage.dep:best_match_to_list,dep_getcpv,dep_getkey,' + \
173 'flatten,get_operator,isjustname,isspecific,isvalidatom,' + \
174 @@ -2118,9 +2124,10 @@
175
176 #getting categories from an external file now
177 categories = [grabfile(os.path.join(x, "categories")) for x in locations]
178 + category_re = dbapi.dbapi._category_re
179 self.categories = tuple(sorted(
180 x for x in stack_lists(categories, incremental=1)
181 - if dbapi._category_re.match(x) is not None))
182 + if category_re.match(x) is not None))
183 del categories
184
185 archlist = [grabfile(os.path.join(x, "arch.list")) for x in locations]
186 @@ -8783,13 +8790,6 @@
187 ]
188 auxdbkeylen=len(auxdbkeys)
189
190 -from portage.dbapi import dbapi
191 -from portage.dbapi.virtual import fakedbapi
192 -from portage.dbapi.bintree import bindbapi, binarytree
193 -from portage.dbapi.vartree import vardbapi, vartree, dblink
194 -from portage.dbapi.porttree import FetchlistDict, \
195 - close_portdbapi_caches, portagetree, portdbapi
196 -
197 def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None,
198 vartree=None, prev_mtimes=None, blockers=None):
199 """will merge a .tbz2 file, returning a list of runtime dependencies
200
201 Modified: main/branches/prefix/pym/portage/glsa.py
202 ===================================================================
203 --- main/branches/prefix/pym/portage/glsa.py 2010-02-22 13:01:13 UTC (rev 15432)
204 +++ main/branches/prefix/pym/portage/glsa.py 2010-02-22 13:02:22 UTC (rev 15433)
205 @@ -268,12 +268,12 @@
206
207 def match(atom, dbapi, match_type="default"):
208 """
209 - wrapper that calls revisionMatch() or portage.dbapi.match() depending on
210 + wrapper that calls revisionMatch() or portage.dbapi.dbapi.match() depending on
211 the given atom.
212
213 @type atom: string
214 @param atom: a <~ or >~ atom or a normal portage atom that contains the atom to match against
215 - @type dbapi: portage.dbapi
216 + @type dbapi: portage.dbapi.dbapi
217 @param dbapi: one of the portage databases to use as information source
218 @type match_type: string
219 @param match_type: if != "default" passed as first argument to dbapi.xmatch
220 @@ -297,7 +297,7 @@
221
222 @type revisionAtom: string
223 @param revisionAtom: a <~ or >~ atom that contains the atom to match against
224 - @type dbapi: portage.dbapi
225 + @type dbapi: portage.dbapi.dbapi
226 @param dbapi: one of the portage databases to use as information source
227 @type match_type: string
228 @param match_type: if != "default" passed as first argument to portdb.xmatch
229
230 Modified: main/branches/prefix/pym/repoman/checks.py
231 ===================================================================
232 --- main/branches/prefix/pym/repoman/checks.py 2010-02-22 13:01:13 UTC (rev 15432)
233 +++ main/branches/prefix/pym/repoman/checks.py 2010-02-22 13:02:22 UTC (rev 15433)
234 @@ -438,6 +438,24 @@
235 re = re.compile('^.*built_with_use')
236 error = errors.BUILT_WITH_USE
237
238 +# EAPI-3 checks
239 +class Eapi3DeprecatedFuncs(LineCheck):
240 + repoman_check_name = 'EAPI.deprecated'
241 + ignore_line = re.compile(r'(^\s*#)')
242 + deprecated_commands_re = re.compile(r'^\s*(check_license)\b')
243 +
244 + def new(self, pkg):
245 + self.eapi = pkg.metadata['EAPI']
246 +
247 + def check_eapi(self, eapi):
248 + return self.eapi not in ('0', '1', '2')
249 +
250 + def check(self, num, line):
251 + m = self.deprecated_commands_re.match(line)
252 + if m is not None:
253 + return ("'%s'" % m.group(1)) + \
254 + " has been deprecated in EAPI=3 on line: %d"
255 +
256 # EAPI-4 checks
257 class Eapi4IncompatibleFuncs(LineCheck):
258 repoman_check_name = 'EAPI.incompatible'
259 @@ -481,7 +499,8 @@
260 IUseUndefined, InheritAutotools,
261 EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded,
262 DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
263 - SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse)))
264 + SrcCompileEconf, Eapi3DeprecatedFuncs,
265 + Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse)))
266
267 _here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')