summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-21 09:53:03 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-21 09:53:03 +0000
commitf413d2daef93ea5f49222a3071c880b4848aac50 (patch)
tree22553bec7b9fd222b95dafa2a784d17b321e65a5
parent22476a23f90ac0522ada9970498f24247312918b (diff)
downloadportage-f413d2daef93ea5f49222a3071c880b4848aac50.tar.gz
portage-f413d2daef93ea5f49222a3071c880b4848aac50.tar.bz2
portage-f413d2daef93ea5f49222a3071c880b4848aac50.zip
Show a deprecation warning when getvirtuals() is called.
svn path=/main/trunk/; revision=15416
-rw-r--r--pym/portage/__init__.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 8af1bb4b1..6515b919e 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -3520,6 +3520,12 @@ class config(object):
self.already_in_regenerate = 0
def get_virts_p(self, myroot=None):
+
+ if myroot is not None:
+ warnings.warn("The 'myroot' parameter for " + \
+ "portage.config.get_virts_p() is deprecated",
+ DeprecationWarning, stacklevel=2)
+
if self.virts_p:
return self.virts_p
virts = self.getvirtuals()
@@ -3533,6 +3539,12 @@ class config(object):
def getvirtuals(self, myroot=None):
"""myroot is now ignored because, due to caching, it has always been
broken for all but the first call."""
+
+ if myroot is not None:
+ warnings.warn("The 'myroot' parameter for " + \
+ "portage.config.getvirtuals() is deprecated",
+ DeprecationWarning, stacklevel=2)
+
myroot = self["ROOT"]
if self.virtuals:
return self.virtuals
@@ -8456,8 +8468,8 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
mysplit = versions._pkgsplit(myslash[-1])
if settings is None:
settings = globals()["settings"]
- virts = settings.getvirtuals("/")
- virts_p = settings.get_virts_p("/")
+ virts = settings.getvirtuals()
+ virts_p = settings.get_virts_p()
if len(myslash)>2:
# this is illegal case.
mysplit=[]
@@ -8947,9 +8959,14 @@ def deprecated_profile_check(settings=None):
# gets virtual package settings
def getvirtuals(myroot):
+ """
+ Calls portage.settings.getvirtuals().
+ @deprecated: Use portage.settings.getvirtuals().
+ """
global settings
- writemsg("--- DEPRECATED call to getvirtual\n")
- return settings.getvirtuals(myroot)
+ warnings.warn("portage.getvirtuals() is deprecated",
+ DeprecationWarning, stacklevel=2)
+ return settings.getvirtuals()
def commit_mtimedb(mydict=None, filename=None):
if mydict is None: