summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dbapi/porttree.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index c925d9bf8..a604260b2 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -1060,7 +1060,7 @@ class portagetree(object):
"""
Constructor for a PortageTree
- @param root: ${ROOT}, defaults to '/', see make.conf(5)
+ @param root: deprectated, defaults to settings['ROOT']
@type root: String/Path
@param virtual: UNUSED
@type virtual: No Idea
@@ -1072,8 +1072,7 @@ class portagetree(object):
settings = portage.settings
self.settings = settings
- self.root = settings['ROOT']
- if root is not None and root != self.root:
+ if root is not None and root != settings['ROOT']:
warnings.warn("The root parameter of the " + \
"portage.dbapi.porttree.portagetree" + \
" constructor is now unused. Use " + \
@@ -1084,6 +1083,15 @@ class portagetree(object):
self.virtual = virtual
self.dbapi = portdbapi(mysettings=settings)
+ @property
+ def root(self):
+ warnings.warn("The root attribute of " + \
+ "portage.dbapi.porttree.portagetree" + \
+ " is deprecated. Use " + \
+ "settings['ROOT'] instead.",
+ DeprecationWarning, stacklevel=2)
+ return self.settings['ROOT']
+
def dep_bestmatch(self,mydep):
"compatibility method"
mymatch = self.dbapi.xmatch("bestmatch-visible",mydep)