From 3d7d91038667a234c8fd41b5e3a7454eb4ae51da Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 2 Mar 2010 20:46:39 +0000 Subject: [PATCH] Remove deprecated methods that call removed key_expand function. (trunk r15404) svn path=/main/branches/2.1.7/; revision=15626 --- pym/portage/dbapi/porttree.py | 16 +-------- pym/portage/dbapi/vartree.py | 62 ++--------------------------------- 2 files changed, 3 insertions(+), 75 deletions(-) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index a4cf16fc0..f40d94d0b 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -25,7 +25,7 @@ from portage.localization import _ from portage.manifest import Manifest from portage import eclass_cache, auxdbkeys, doebuild, flatten, \ - listdir, dep_expand, eapi_is_supported, key_expand, dep_check, \ + listdir, dep_expand, eapi_is_supported, dep_check, \ _eapi_is_deprecated from portage import os from portage import _encodings @@ -1227,20 +1227,6 @@ class portagetree(object): psplit = pkgsplit(mysplit[1]) 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 - mykey = key_expand(cps[0]+"/"+cps[1], mydb=self.dbapi, - settings=self.settings) - mykey = mykey + "-" + cps[2] - if cps[3] != "r0": - mykey = mykey + "-" + cps[3] - return mykey - def depcheck(self, mycheck, use="yes", myusesplit=None): return dep_check(mycheck, self.dbapi, use=use, myuse=myusesplit) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 89b35e5cf..d2615cc7a 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -32,7 +32,7 @@ from portage.exception import CommandNotFound, \ FileNotFound, PermissionDenied, UnsupportedAPIException from portage.localization import _ -from portage import listdir, dep_expand, digraph, flatten, key_expand, \ +from portage import listdir, dep_expand, digraph, flatten, \ doebuild_environment, doebuild, env_update, prepare_build_dirs, \ abssymlink, movefile, _movefile, bsd_chflags, cpv_getkey @@ -969,7 +969,7 @@ class vartree(object): self.root = root[:] if settings is None: from portage import settings - self.settings = settings # for key_expand calls + self.settings = settings if categories is None: categories = settings.categories self.dbapi = vardbapi(self.root, categories=categories, @@ -1054,50 +1054,10 @@ class vartree(object): masked package for nodes in this nodes list.""" return self.dbapi.cp_all() - def exists_specific_cat(self, cpv, use_cache=1): - warnings.warn( - "portage.dbapi.vartree.vartree.exists_specific_cat() is deprecated", - DeprecationWarning) - cpv = key_expand(cpv, mydb=self.dbapi, use_cache=use_cache, - settings=self.settings) - a = catpkgsplit(cpv) - if not a: - return 0 - mylist = listdir(self.getpath(a[0]), EmptyOnError=1) - for x in mylist: - b = pkgsplit(x) - if not b: - self.dbapi.invalidentry(self.getpath(a[0], filename=x)) - continue - if a[1] == b[0]: - return 1 - return 0 - def getebuildpath(self, fullpackage): cat, package = catsplit(fullpackage) return self.getpath(fullpackage, filename=package+".ebuild") - def getnode(self, mykey, use_cache=1): - warnings.warn( - "portage.dbapi.vartree.vartree.getnode() is deprecated", - DeprecationWarning) - mykey = key_expand(mykey, mydb=self.dbapi, use_cache=use_cache, - settings=self.settings) - if not mykey: - return [] - mysplit = catsplit(mykey) - mydirlist = listdir(self.getpath(mysplit[0]),EmptyOnError=1) - returnme = [] - for x in mydirlist: - mypsplit = pkgsplit(x) - if not mypsplit: - self.dbapi.invalidentry(self.getpath(mysplit[0], filename=x)) - continue - if mypsplit[0] == mysplit[1]: - appendme = [mysplit[0]+"/"+x, [mysplit[0], mypsplit[0], mypsplit[1], mypsplit[2]]] - returnme.append(appendme) - return returnme - def getslot(self, mycatpkg): "Get a slot for a catpkg; assume it exists." try: @@ -1105,24 +1065,6 @@ class vartree(object): except KeyError: return "" - def hasnode(self, mykey, use_cache): - """Does the particular node (cat/pkg key) exist?""" - warnings.warn( - "portage.dbapi.vartree.vartree.hadnode() is deprecated", - DeprecationWarning) - mykey = key_expand(mykey, mydb=self.dbapi, use_cache=use_cache, - settings=self.settings) - mysplit = catsplit(mykey) - mydirlist = listdir(self.getpath(mysplit[0]), EmptyOnError=1) - for x in mydirlist: - mypsplit = pkgsplit(x) - if not mypsplit: - self.dbapi.invalidentry(self.getpath(mysplit[0], filename=x)) - continue - if mypsplit[0] == mysplit[1]: - return 1 - return 0 - def populate(self): self.populated=1 -- 2.26.2