Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15306 - in main/trunk: bin pym/_emerge pym/portage pym/portage/dbapi
Date: Sun, 31 Jan 2010 21:53:26
Message-Id: E1NbhjN-0001Tz-8i@stork.gentoo.org
1 Author: zmedico
2 Date: 2010-01-31 21:53:20 +0000 (Sun, 31 Jan 2010)
3 New Revision: 15306
4
5 Modified:
6 main/trunk/bin/repoman
7 main/trunk/pym/_emerge/main.py
8 main/trunk/pym/portage/dbapi/__init__.py
9 main/trunk/pym/portage/dbapi/porttree.py
10 main/trunk/pym/portage/news.py
11 Log:
12 Deprecate pordbapi.mysettings since the portdbapi.settings alias is now
13 supported by stable portage.
14
15
16 Modified: main/trunk/bin/repoman
17 ===================================================================
18 --- main/trunk/bin/repoman 2010-01-31 21:25:31 UTC (rev 15305)
19 +++ main/trunk/bin/repoman 2010-01-31 21:53:20 UTC (rev 15306)
20 @@ -557,7 +557,7 @@
21 portage.util.stack_lists([categories], incremental=1)))
22 del categories
23
24 -portdb.mysettings = repoman_settings
25 +portdb.settings = repoman_settings
26 root_config = RootConfig(repoman_settings, trees[root], None)
27 # We really only need to cache the metadata that's necessary for visibility
28 # filtering. Anything else can be discarded to reduce memory consumption.
29 @@ -1770,7 +1770,7 @@
30 arch_xmatch_caches[xmatch_cache_key] = xcache
31
32 trees["/"]["porttree"].settings = dep_settings
33 - portdb.mysettings = dep_settings
34 + portdb.settings = dep_settings
35 portdb.xcache = xcache
36 # for package.use.mask support inside dep_check
37 dep_settings.setcpv(pkg)
38
39 Modified: main/trunk/pym/_emerge/main.py
40 ===================================================================
41 --- main/trunk/pym/_emerge/main.py 2010-01-31 21:25:31 UTC (rev 15305)
42 +++ main/trunk/pym/_emerge/main.py 2010-01-31 21:53:20 UTC (rev 15306)
43 @@ -1080,7 +1080,7 @@
44 for root, root_trees in trees.items():
45 if 'porttree' in root_trees:
46 portdb = root_trees['porttree'].dbapi
47 - if portdb.mysettings.get('PORTAGE_REPO_DUPLICATE_WARN') != '0':
48 + if portdb.settings.get('PORTAGE_REPO_DUPLICATE_WARN') != '0':
49 for repo_name, paths in portdb._ignored_repos:
50 k = (root, repo_name, portdb.getRepositoryPath(repo_name))
51 ignored_repos.setdefault(k, []).extend(paths)
52
53 Modified: main/trunk/pym/portage/dbapi/__init__.py
54 ===================================================================
55 --- main/trunk/pym/portage/dbapi/__init__.py 2010-01-31 21:25:31 UTC (rev 15305)
56 +++ main/trunk/pym/portage/dbapi/__init__.py 2010-01-31 21:53:20 UTC (rev 15306)
57 @@ -171,7 +171,7 @@
58 continue
59 else:
60 # Check masked and forced flags for repoman.
61 - mysettings = getattr(self, "mysettings", None)
62 + mysettings = getattr(self, 'settings', None)
63 if mysettings is not None and not mysettings.local_config:
64
65 pkg = "%s:%s" % (cpv, slot)
66
67 Modified: main/trunk/pym/portage/dbapi/porttree.py
68 ===================================================================
69 --- main/trunk/pym/portage/dbapi/porttree.py 2010-01-31 21:25:31 UTC (rev 15305)
70 +++ main/trunk/pym/portage/dbapi/porttree.py 2010-01-31 21:53:20 UTC (rev 15306)
71 @@ -125,17 +125,22 @@
72 _use_mutable = True
73
74 def _get_settings(self):
75 - return self.mysettings
76 + warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings",
77 + DeprecationWarning)
78 + return self.settings
79
80 def _set_settings(self, settings):
81 - self.mysettings = settings
82 + warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings",
83 + DeprecationWarning)
84 + self.settings = settings
85
86 def _del_settings (self):
87 - del self.mysettings
88 + warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings",
89 + DeprecationWarning)
90 + del self.settings
91
92 - settings = property(_get_settings, _set_settings, _del_settings,
93 - "Define self.settings as an alias for self.mysettings, " + \
94 - "for conformity with other dbapi classes.")
95 + mysettings = property(_get_settings, _set_settings, _del_settings,
96 + "Deprecated self.mysettings, only for backward compatibility")
97
98 @property
99 def _categories(self):
100 @@ -152,12 +157,12 @@
101
102 from portage import config
103 if mysettings:
104 - self.mysettings = mysettings
105 + self.settings = mysettings
106 else:
107 from portage import settings
108 - self.mysettings = config(clone=settings)
109 + self.settings = config(clone=settings)
110
111 - porttree_root = self.mysettings['PORTDIR']
112 + porttree_root = self.settings['PORTDIR']
113
114 # always show this warning after this parameter
115 # is unused in stable portage
116 @@ -172,8 +177,8 @@
117 # is generated by the depend phase. It's safest to use a clone for
118 # this purpose because doebuild makes many changes to the config
119 # instance that is passed in.
120 - self.doebuild_settings = config(clone=self.mysettings)
121 - self.depcachedir = os.path.realpath(self.mysettings.depcachedir)
122 + self.doebuild_settings = config(clone=self.settings)
123 + self.depcachedir = os.path.realpath(self.settings.depcachedir)
124
125 if os.environ.get("SANDBOX_ON") == "1":
126 # Make api consumers exempt from sandbox violations
127 @@ -186,7 +191,7 @@
128
129 porttrees = [os.path.realpath(porttree_root)]
130 porttrees.extend(os.path.realpath(x) for x in \
131 - self.mysettings.get('PORTDIR_OVERLAY', '').split())
132 + self.settings.get('PORTDIR_OVERLAY', '').split())
133 treemap = {}
134 repository_map = {}
135 self.treemap = treemap
136 @@ -242,7 +247,7 @@
137 self._have_root_eclass_dir = os.path.isdir(
138 os.path.join(self.porttree_root, "eclass"))
139
140 - self.metadbmodule = self.mysettings.load_best_module("portdbapi.metadbmodule")
141 + self.metadbmodule = self.settings.load_best_module("portdbapi.metadbmodule")
142
143 #if the portdbapi is "frozen", then we assume that we can cache everything (that no updates to it are happening)
144 self.xcache = {}
145 @@ -250,7 +255,7 @@
146
147 self._repo_info = {}
148 eclass_dbs = {porttree_root : self.eclassdb}
149 - local_repo_configs = self.mysettings._local_repo_configs
150 + local_repo_configs = self.settings._local_repo_configs
151 default_loc_repo_config = None
152 repo_aliases = {}
153 if local_repo_configs is not None:
154 @@ -265,7 +270,7 @@
155 "'%s' alias in " \
156 "'%s'\n") % (alias, repo_name,
157 overridden_alias,
158 - self.mysettings._local_repo_conf_path),
159 + self.settings._local_repo_conf_path),
160 level=logging.WARNING, noiselevel=-1)
161 repo_aliases[alias] = repo_name
162
163 @@ -324,7 +329,7 @@
164 writemsg_level(_("Unavailable repository '%s' " \
165 "referenced by eclass-overrides entry in " \
166 "'%s'\n") % (other_name,
167 - self.mysettings._local_repo_conf_path),
168 + self.settings._local_repo_conf_path),
169 level=logging.ERROR, noiselevel=-1)
170 continue
171 porttrees.append(other_path)
172 @@ -342,7 +347,7 @@
173
174 self._repo_info[path] = _repo_info(repo_name, path, eclass_db)
175
176 - self.auxdbmodule = self.mysettings.load_best_module("portdbapi.auxdbmodule")
177 + self.auxdbmodule = self.settings.load_best_module("portdbapi.auxdbmodule")
178 self.auxdb = {}
179 self._pregen_auxdb = {}
180 self._init_cache_dirs()
181 @@ -379,7 +384,7 @@
182 self.depcachedir, x, filtered_auxdbkeys, **cache_kwargs)
183 if self.auxdbmodule is metadata_overlay.database:
184 self.auxdb[x].db_ro.ec = self._repo_info[x].eclass_db
185 - if "metadata-transfer" not in self.mysettings.features:
186 + if "metadata-transfer" not in self.settings.features:
187 for x in self.porttrees:
188 if x in self._pregen_auxdb:
189 continue
190 @@ -806,7 +811,7 @@
191 if myebuild is None:
192 raise AssertionError("ebuild not found for '%s'" % mypkg)
193 pkgdir = os.path.dirname(myebuild)
194 - mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
195 + mf = Manifest(pkgdir, self.settings["DISTDIR"])
196 checksums = mf.getDigests()
197 if not checksums:
198 if debug:
199 @@ -821,7 +826,7 @@
200 if debug:
201 writemsg(_("[bad digest]: missing %(file)s for %(pkg)s\n") % {"file":myfile, "pkg":mypkg})
202 continue
203 - file_path = os.path.join(self.mysettings["DISTDIR"], myfile)
204 + file_path = os.path.join(self.settings["DISTDIR"], myfile)
205 mystat = None
206 try:
207 mystat = os.stat(file_path)
208 @@ -851,7 +856,7 @@
209 if myebuild is None:
210 raise AssertionError("ebuild not found for '%s'" % mypkg)
211 pkgdir = os.path.dirname(myebuild)
212 - mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
213 + mf = Manifest(pkgdir, self.settings["DISTDIR"])
214 mysums = mf.getDigests()
215
216 failures = {}
217 @@ -862,7 +867,7 @@
218 else:
219 try:
220 ok, reason = portage.checksum.verify_all(
221 - os.path.join(self.mysettings["DISTDIR"], x), mysums[x])
222 + os.path.join(self.settings["DISTDIR"], x), mysums[x])
223 except FileNotFound as e:
224 ok = False
225 reason = _("File Not Found: '%s'") % (e,)
226 @@ -887,7 +892,7 @@
227 def cp_all(self):
228 "returns a list of all keys in our tree"
229 d = {}
230 - for x in self.mysettings.categories:
231 + for x in self.settings.categories:
232 for oroot in self.porttrees:
233 for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1):
234 if not self._pkg_dir_name_re.match(y) or \
235 @@ -948,7 +953,7 @@
236 if invalid_category and d:
237 writemsg(_("\n!!! '%s' has a category that is not listed in " \
238 "%setc/portage/categories\n") % \
239 - (mycp, self.mysettings["PORTAGE_CONFIGROOT"]), noiselevel=-1)
240 + (mycp, self.settings["PORTAGE_CONFIGROOT"]), noiselevel=-1)
241 mylist = []
242 else:
243 mylist = list(d)
244 @@ -986,7 +991,7 @@
245 if not mydep:
246 #this stuff only runs on first call of xmatch()
247 #create mydep, mykey from origdep
248 - mydep = dep_expand(origdep, mydb=self, settings=self.mysettings)
249 + mydep = dep_expand(origdep, mydb=self, settings=self.settings)
250 mykey = mydep.cp
251
252 if level == "list-visible":
253 @@ -1015,7 +1020,7 @@
254 else:
255 mylist = match_from_list(mydep, self.cp_list(mykey))
256 myval = ""
257 - settings = self.mysettings
258 + settings = self.settings
259 local_config = settings.local_config
260 aux_keys = list(self._aux_cache_keys)
261 if level == "minimum-visible":
262 @@ -1102,8 +1107,8 @@
263
264 db_keys = ["SLOT"]
265 visible = []
266 - getMaskAtom = self.mysettings._getMaskAtom
267 - getProfileMaskAtom = self.mysettings._getProfileMaskAtom
268 + getMaskAtom = self.settings._getMaskAtom
269 + getProfileMaskAtom = self.settings._getProfileMaskAtom
270 for cpv in mylist:
271 try:
272 metadata = dict(zip(db_keys, self.aux_get(cpv, db_keys)))
273 @@ -1127,9 +1132,9 @@
274 newlist=[]
275 aux_keys = list(self._aux_cache_keys)
276 metadata = {}
277 - local_config = self.mysettings.local_config
278 - chost = self.mysettings.get('CHOST', '')
279 - accept_chost = self.mysettings._accept_chost
280 + local_config = self.settings.local_config
281 + chost = self.settings.get('CHOST', '')
282 + accept_chost = self.settings._accept_chost
283 for mycpv in mylist:
284 metadata.clear()
285 try:
286 @@ -1147,7 +1152,7 @@
287 continue
288 if _eapi_is_deprecated(eapi):
289 continue
290 - if self.mysettings._getMissingKeywords(mycpv, metadata):
291 + if self.settings._getMissingKeywords(mycpv, metadata):
292 continue
293 if local_config:
294 metadata['CHOST'] = chost
295 @@ -1158,9 +1163,9 @@
296 self.doebuild_settings.setcpv(mycpv, mydb=metadata)
297 metadata['USE'] = self.doebuild_settings['PORTAGE_USE']
298 try:
299 - if self.mysettings._getMissingLicenses(mycpv, metadata):
300 + if self.settings._getMissingLicenses(mycpv, metadata):
301 continue
302 - if self.mysettings._getMissingProperties(mycpv, metadata):
303 + if self.settings._getMissingProperties(mycpv, metadata):
304 continue
305 except InvalidDependString:
306 continue
307
308 Modified: main/trunk/pym/portage/news.py
309 ===================================================================
310 --- main/trunk/pym/portage/news.py 2010-01-31 21:25:31 UTC (rev 15305)
311 +++ main/trunk/pym/portage/news.py 2010-01-31 21:53:20 UTC (rev 15306)
312 @@ -59,9 +59,9 @@
313 portdir = portdb.porttree_root
314 profiles_base = os.path.join(portdir, 'profiles') + os.path.sep
315 profile_path = None
316 - if portdb.mysettings.profile_path:
317 + if portdb.settings.profile_path:
318 profile_path = normalize_path(
319 - os.path.realpath(portdb.mysettings.profile_path))
320 + os.path.realpath(portdb.settings.profile_path))
321 if profile_path.startswith(profiles_base):
322 profile_path = profile_path[len(profiles_base):]
323 self._profile_path = profile_path