_use_mutable = True
def _get_settings(self):
- return self.mysettings
+ warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings",
+ DeprecationWarning)
+ return self.settings
def _set_settings(self, settings):
- self.mysettings = settings
+ warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings",
+ DeprecationWarning)
+ self.settings = settings
def _del_settings (self):
- del self.mysettings
+ warnings.warn("Use portdbapi.settings insead of portdbapi.mysettings",
+ DeprecationWarning)
+ del self.settings
- settings = property(_get_settings, _set_settings, _del_settings,
- "Define self.settings as an alias for self.mysettings, " + \
- "for conformity with other dbapi classes.")
+ mysettings = property(_get_settings, _set_settings, _del_settings,
+ "Deprecated self.mysettings, only for backward compatibility")
@property
def _categories(self):
from portage import config
if mysettings:
- self.mysettings = mysettings
+ self.settings = mysettings
else:
from portage import settings
- self.mysettings = config(clone=settings)
+ self.settings = config(clone=settings)
- porttree_root = self.mysettings['PORTDIR']
+ porttree_root = self.settings['PORTDIR']
# always show this warning after this parameter
# is unused in stable portage
# is generated by the depend phase. It's safest to use a clone for
# this purpose because doebuild makes many changes to the config
# instance that is passed in.
- self.doebuild_settings = config(clone=self.mysettings)
- self.depcachedir = os.path.realpath(self.mysettings.depcachedir)
+ self.doebuild_settings = config(clone=self.settings)
+ self.depcachedir = os.path.realpath(self.settings.depcachedir)
if os.environ.get("SANDBOX_ON") == "1":
# Make api consumers exempt from sandbox violations
porttrees = [os.path.realpath(porttree_root)]
porttrees.extend(os.path.realpath(x) for x in \
- self.mysettings.get('PORTDIR_OVERLAY', '').split())
+ self.settings.get('PORTDIR_OVERLAY', '').split())
treemap = {}
repository_map = {}
self.treemap = treemap
self._have_root_eclass_dir = os.path.isdir(
os.path.join(self.porttree_root, "eclass"))
- self.metadbmodule = self.mysettings.load_best_module("portdbapi.metadbmodule")
+ self.metadbmodule = self.settings.load_best_module("portdbapi.metadbmodule")
#if the portdbapi is "frozen", then we assume that we can cache everything (that no updates to it are happening)
self.xcache = {}
self._repo_info = {}
eclass_dbs = {porttree_root : self.eclassdb}
- local_repo_configs = self.mysettings._local_repo_configs
+ local_repo_configs = self.settings._local_repo_configs
default_loc_repo_config = None
repo_aliases = {}
if local_repo_configs is not None:
"'%s' alias in " \
"'%s'\n") % (alias, repo_name,
overridden_alias,
- self.mysettings._local_repo_conf_path),
+ self.settings._local_repo_conf_path),
level=logging.WARNING, noiselevel=-1)
repo_aliases[alias] = repo_name
writemsg_level(_("Unavailable repository '%s' " \
"referenced by eclass-overrides entry in " \
"'%s'\n") % (other_name,
- self.mysettings._local_repo_conf_path),
+ self.settings._local_repo_conf_path),
level=logging.ERROR, noiselevel=-1)
continue
porttrees.append(other_path)
self._repo_info[path] = _repo_info(repo_name, path, eclass_db)
- self.auxdbmodule = self.mysettings.load_best_module("portdbapi.auxdbmodule")
+ self.auxdbmodule = self.settings.load_best_module("portdbapi.auxdbmodule")
self.auxdb = {}
self._pregen_auxdb = {}
self._init_cache_dirs()
self.depcachedir, x, filtered_auxdbkeys, **cache_kwargs)
if self.auxdbmodule is metadata_overlay.database:
self.auxdb[x].db_ro.ec = self._repo_info[x].eclass_db
- if "metadata-transfer" not in self.mysettings.features:
+ if "metadata-transfer" not in self.settings.features:
for x in self.porttrees:
if x in self._pregen_auxdb:
continue
if myebuild is None:
raise AssertionError("ebuild not found for '%s'" % mypkg)
pkgdir = os.path.dirname(myebuild)
- mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
+ mf = Manifest(pkgdir, self.settings["DISTDIR"])
checksums = mf.getDigests()
if not checksums:
if debug:
if debug:
writemsg(_("[bad digest]: missing %(file)s for %(pkg)s\n") % {"file":myfile, "pkg":mypkg})
continue
- file_path = os.path.join(self.mysettings["DISTDIR"], myfile)
+ file_path = os.path.join(self.settings["DISTDIR"], myfile)
mystat = None
try:
mystat = os.stat(file_path)
if myebuild is None:
raise AssertionError("ebuild not found for '%s'" % mypkg)
pkgdir = os.path.dirname(myebuild)
- mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
+ mf = Manifest(pkgdir, self.settings["DISTDIR"])
mysums = mf.getDigests()
failures = {}
else:
try:
ok, reason = portage.checksum.verify_all(
- os.path.join(self.mysettings["DISTDIR"], x), mysums[x])
+ os.path.join(self.settings["DISTDIR"], x), mysums[x])
except FileNotFound as e:
ok = False
reason = _("File Not Found: '%s'") % (e,)
def cp_all(self):
"returns a list of all keys in our tree"
d = {}
- for x in self.mysettings.categories:
+ for x in self.settings.categories:
for oroot in self.porttrees:
for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1):
if not self._pkg_dir_name_re.match(y) or \
if invalid_category and d:
writemsg(_("\n!!! '%s' has a category that is not listed in " \
"%setc/portage/categories\n") % \
- (mycp, self.mysettings["PORTAGE_CONFIGROOT"]), noiselevel=-1)
+ (mycp, self.settings["PORTAGE_CONFIGROOT"]), noiselevel=-1)
mylist = []
else:
mylist = list(d)
if not mydep:
#this stuff only runs on first call of xmatch()
#create mydep, mykey from origdep
- mydep = dep_expand(origdep, mydb=self, settings=self.mysettings)
+ mydep = dep_expand(origdep, mydb=self, settings=self.settings)
mykey = mydep.cp
if level == "list-visible":
else:
mylist = match_from_list(mydep, self.cp_list(mykey))
myval = ""
- settings = self.mysettings
+ settings = self.settings
local_config = settings.local_config
aux_keys = list(self._aux_cache_keys)
if level == "minimum-visible":
db_keys = ["SLOT"]
visible = []
- getMaskAtom = self.mysettings._getMaskAtom
- getProfileMaskAtom = self.mysettings._getProfileMaskAtom
+ getMaskAtom = self.settings._getMaskAtom
+ getProfileMaskAtom = self.settings._getProfileMaskAtom
for cpv in mylist:
try:
metadata = dict(zip(db_keys, self.aux_get(cpv, db_keys)))
newlist=[]
aux_keys = list(self._aux_cache_keys)
metadata = {}
- local_config = self.mysettings.local_config
- chost = self.mysettings.get('CHOST', '')
- accept_chost = self.mysettings._accept_chost
+ local_config = self.settings.local_config
+ chost = self.settings.get('CHOST', '')
+ accept_chost = self.settings._accept_chost
for mycpv in mylist:
metadata.clear()
try:
continue
if _eapi_is_deprecated(eapi):
continue
- if self.mysettings._getMissingKeywords(mycpv, metadata):
+ if self.settings._getMissingKeywords(mycpv, metadata):
continue
if local_config:
metadata['CHOST'] = chost
self.doebuild_settings.setcpv(mycpv, mydb=metadata)
metadata['USE'] = self.doebuild_settings['PORTAGE_USE']
try:
- if self.mysettings._getMissingLicenses(mycpv, metadata):
+ if self.settings._getMissingLicenses(mycpv, metadata):
continue
- if self.mysettings._getMissingProperties(mycpv, metadata):
+ if self.settings._getMissingProperties(mycpv, metadata):
continue
except InvalidDependString:
continue