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
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)
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
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,
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:
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