From 1a6c6c29d1046f56c7661fb5f970597554349838 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 10 Dec 2011 13:46:58 -0800 Subject: [PATCH] Make eprefix=None params map to const.EPREFIX --- pym/portage/__init__.py | 2 +- pym/portage/package/ebuild/_config/LocationsManager.py | 5 +++-- pym/portage/package/ebuild/config.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 1df956633..339c64fc6 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -487,7 +487,7 @@ class _trees_dict(dict): self._target_eroot = None def create_trees(config_root=None, target_root=None, trees=None, env=None, - eprefix=portage.const.EPREFIX): + eprefix=None): if trees is not None: # clean up any existing portdbapi instances for myroot in trees: diff --git a/pym/portage/package/ebuild/_config/LocationsManager.py b/pym/portage/package/ebuild/_config/LocationsManager.py index f559bb52b..8ad41f747 100644 --- a/pym/portage/package/ebuild/_config/LocationsManager.py +++ b/pym/portage/package/ebuild/_config/LocationsManager.py @@ -9,6 +9,7 @@ import collections import io import warnings +import portage from portage import os, eapi_is_supported, _encodings, _unicode_encode from portage.const import CUSTOM_PROFILE_PATH, GLOBAL_CONFIG_PATH, \ PROFILE_PATH, USER_CONFIG_PATH @@ -37,9 +38,9 @@ class LocationsManager(object): self.config_root = config_root self.target_root = target_root self._user_config = local_config - + if self.eprefix is None: - self.eprefix = "" + self.eprefix = portage.const.EPREFIX if self.config_root is None: self.config_root = self.eprefix + os.sep diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 9bb26cad0..a8ec3c47f 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -143,7 +143,7 @@ class config(object): def __init__(self, clone=None, mycpv=None, config_profile_path=None, config_incrementals=None, config_root=None, target_root=None, - eprefix=portage.const.EPREFIX, local_config=True, env=None, + eprefix=None, local_config=True, env=None, _unmatched_removal=False): """ @param clone: If provided, init will use deepcopy to copy by value the instance. @@ -160,7 +160,7 @@ class config(object): @type config_root: String @param target_root: __init__ override of $ROOT env variable. @type target_root: String - @param eprefix: set the EPREFIX variable + @param eprefix: set the EPREFIX variable (default is portage.const.EPREFIX) @type eprefix: String @param local_config: Enables loading of local config (/etc/portage); used most by repoman to ignore local config (keywording and unmasking) -- 2.26.2