Deprecate key_expand and portage.dbapi.porttree.portagetree.resolve_specific
authorZac Medico <zmedico@gentoo.org>
Mon, 21 Sep 2009 14:34:13 +0000 (14:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 21 Sep 2009 14:34:13 +0000 (14:34 -0000)
which calls it.

svn path=/main/trunk/; revision=14322

pym/portage/__init__.py
pym/portage/dbapi/porttree.py

index c8dff4c5c8c146620bc9167b283b5be57a3f570b..e3fee8084214486b03b4e64c1c0ed222c24a37bf 100644 (file)
@@ -8057,6 +8057,9 @@ def cpv_getkey(mycpv):
 getCPFromCPV = cpv_getkey
 
 def key_expand(mykey, mydb=None, use_cache=1, settings=None):
+       """This is deprecated because it just returns the first match instead of
+       raising AmbiguousPackageName like cpv_expand does."""
+       warnings.warn("portage.key_expand() is deprecated", DeprecationWarning)
        mysplit=mykey.split("/")
        if settings is None:
                settings = globals()["settings"]
index ea22abd11ac5b24ea2d4fcbc97ef0312dadf2a94..98af60d7f725970da35d854f2ff8f2aa7fcb1089 100644 (file)
@@ -35,6 +35,7 @@ from portage import _unicode_encode
 import codecs
 import logging
 import stat
+import warnings
 
 def _src_uri_validate(cpv, eapi, src_uri):
        """
@@ -1196,6 +1197,9 @@ class portagetree(object):
                return "/".join([self.portroot, mysplit[0], psplit[0], mysplit[1]])+".ebuild"
 
        def resolve_specific(self, myspec):
+               warnings.warn(
+                       "portage.dbapi.porttree.portagetree.resolve_specific() is deprecated",
+                       DeprecationWarning)
                cps = catpkgsplit(myspec)
                if not cps:
                        return None