Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15281 - in main/trunk: bin pym/portage/dbapi
Date: Sat, 30 Jan 2010 12:46:41
Message-Id: E1NbCic-0006LS-OW@stork.gentoo.org
1 Author: zmedico
2 Date: 2010-01-30 12:46:30 +0000 (Sat, 30 Jan 2010)
3 New Revision: 15281
4
5 Modified:
6 main/trunk/bin/egencache
7 main/trunk/pym/portage/dbapi/porttree.py
8 Log:
9 Deprecate the first parameter of the portdbapi constructor since it is always
10 the same as mysettings['PORTDIR'].
11
12
13 Modified: main/trunk/bin/egencache
14 ===================================================================
15 --- main/trunk/bin/egencache 2010-01-30 10:41:23 UTC (rev 15280)
16 +++ main/trunk/bin/egencache 2010-01-30 12:46:30 UTC (rev 15281)
17 @@ -326,7 +326,7 @@
18
19 settings.lock()
20
21 - portdb = portage.portdbapi(settings["PORTDIR"], mysettings=settings)
22 + portdb = portage.portdbapi(mysettings=settings)
23 if options.repo is not None:
24 repo_path = portdb.getRepositoryPath(options.repo)
25 if repo_path is None:
26
27 Modified: main/trunk/pym/portage/dbapi/porttree.py
28 ===================================================================
29 --- main/trunk/pym/portage/dbapi/porttree.py 2010-01-30 10:41:23 UTC (rev 15280)
30 +++ main/trunk/pym/portage/dbapi/porttree.py 2010-01-30 12:46:30 UTC (rev 15281)
31 @@ -141,7 +141,13 @@
32 def _categories(self):
33 return self.settings.categories
34
35 - def __init__(self, porttree_root, mysettings=None):
36 + def __init__(self, _unused_param=None, mysettings=None):
37 + """
38 + @param _unused_param: deprecated
39 + @type _unused_param: None
40 + @param mysettings: an immutable config instance
41 + @type mysettings: portage.config
42 + """
43 portdbapi.portdbapi_instances.append(self)
44
45 from portage import config
46 @@ -151,6 +157,15 @@
47 from portage import settings
48 self.mysettings = config(clone=settings)
49
50 + if _unused_param is not None:
51 + warnings.warn("The first parameter of the " + \
52 + "portage.dbapi.porttree.portdbapi" + \
53 + " constructor is now unused. Use " + \
54 + "mysettings['PORTDIR'] instead.",
55 + DeprecationWarning)
56 +
57 + porttree_root = self.mysettings['PORTDIR']
58 +
59 # This is strictly for use in aux_get() doebuild calls when metadata
60 # is generated by the depend phase. It's safest to use a clone for
61 # this purpose because doebuild makes many changes to the config
62 @@ -1182,8 +1197,7 @@
63 self.settings = settings
64 self.portroot = settings["PORTDIR"]
65 self.virtual = virtual
66 - self.dbapi = portdbapi(
67 - settings["PORTDIR"], mysettings=settings)
68 + self.dbapi = portdbapi(mysettings=settings)
69
70 def dep_bestmatch(self,mydep):
71 "compatibility method"