config: make eprefix constructor parameter public
authorZac Medico <zmedico@gentoo.org>
Sat, 10 Dec 2011 06:13:29 +0000 (22:13 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 10 Dec 2011 06:13:29 +0000 (22:13 -0800)
bin/egencache
bin/repoman
pym/portage/__init__.py
pym/portage/package/ebuild/config.py
pym/portage/tests/dbapi/test_fakedbapi.py

index 532cc034cde7e1c7d92e26823045a442390b990b..6d18f66e554a448f638e017cdfceadaa39df8004 100755 (executable)
@@ -844,7 +844,7 @@ def egencache_main(args):
        eprefix = portage.const.EPREFIX
 
        settings = portage.config(config_root=config_root,
-               local_config=False, env=env, _eprefix=eprefix)
+               local_config=False, env=env, eprefix=eprefix)
 
        default_opts = None
        if not options.ignore_default_opts:
@@ -857,7 +857,7 @@ def egencache_main(args):
                        env['PORTAGE_DEPCACHEDIR'] = options.cache_dir
 
                settings = portage.config(config_root=config_root,
-                       local_config=False, env=env, _eprefix=eprefix)
+                       local_config=False, env=env, eprefix=eprefix)
 
        if not options.update and not options.update_use_local_desc \
                        and not options.update_changelogs:
index 6ea15678d70d5c6b60931d1e821b39c5ea8218e8..24e8f77b69f8e2f358917adaa7f232c99fd334c4 100755 (executable)
@@ -96,7 +96,7 @@ os.umask(0o22)
 repoman_incrementals = tuple(x for x in \
        portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
 eprefix = portage.const.EPREFIX
-repoman_settings = portage.config(local_config=False, _eprefix=eprefix)
+repoman_settings = portage.config(local_config=False, eprefix=eprefix)
 repoman_settings.lock()
 
 if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
@@ -565,13 +565,13 @@ if options.mode == 'commit' and not options.pretend and not vcs:
        options.pretend = True
 
 # Ensure that PORTDIR_OVERLAY contains the repository corresponding to $PWD.
-repoman_settings = portage.config(local_config=False, _eprefix=eprefix)
+repoman_settings = portage.config(local_config=False, eprefix=eprefix)
 repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % \
        (repoman_settings.get('PORTDIR_OVERLAY', ''),
        portage._shell_quote(portdir_overlay))
 # We have to call the config constructor again so
 # that config.repositories is initialized correctly.
-repoman_settings = portage.config(local_config=False, _eprefix=eprefix,
+repoman_settings = portage.config(local_config=False, eprefix=eprefix,
        env=dict(os.environ, PORTDIR_OVERLAY=repoman_settings['PORTDIR_OVERLAY']))
 
 root = repoman_settings['EROOT']
@@ -2005,7 +2005,7 @@ for x in effective_scanlist:
                                                config_incrementals=repoman_incrementals,
                                                local_config=False,
                                                _unmatched_removal=options.unmatched_removal,
-                                               env=env, _eprefix=eprefix)
+                                               env=env, eprefix=eprefix)
                                        dep_settings.categories = repoman_settings.categories
                                        if options.without_mask:
                                                dep_settings._mask_manager = \
index bdfb4e29d3d99f4cdacdfd7c53b70774b3da33bf..5a1866ff126dab97b20de2a4c49f71ea59396366 100644 (file)
@@ -508,7 +508,7 @@ def create_trees(config_root=None, target_root=None, trees=None, env=None):
        if eprefix is None:
                eprefix = portage.const.EPREFIX
        settings = config(config_root=config_root, target_root=target_root,
-               env=env, _eprefix=eprefix)
+               env=env, eprefix=eprefix)
        settings.lock()
 
        trees._target_eroot = settings['EROOT']
@@ -528,7 +528,7 @@ def create_trees(config_root=None, target_root=None, trees=None, env=None):
                        if v is not None:
                                clean_env[k] = v
                settings = config(config_root=None, target_root="/",
-                       env=clean_env, _eprefix=eprefix)
+                       env=clean_env, eprefix=eprefix)
                settings.lock()
                trees._running_eroot = settings['EROOT']
                myroots.append((settings['EROOT'], settings))
index 40a61a43a0fd57a8c14eafa5dbed4340b403e56f..87cefee61f17c800ec5bd89cb401fb84c66355be 100644 (file)
@@ -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=portage.const.EPREFIX, local_config=True, env=None,
                _unmatched_removal=False):
                """
                @param clone: If provided, init will use deepcopy to copy by value the instance.
@@ -160,8 +160,8 @@ 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 (private, used by internal tests)
-               @type _eprefix: String
+               @param eprefix: set the EPREFIX variable
+               @type eprefix: String
                @param local_config: Enables loading of local config (/etc/portage); used most by repoman to
                ignore local config (keywording and unmasking)
                @type local_config: Boolean
@@ -173,10 +173,6 @@ class config(object):
                @type _unmatched_removal: Boolean
                """
 
-               # rename local _eprefix variable for convenience
-               eprefix = _eprefix
-               del _eprefix
-
                # When initializing the global portage.settings instance, avoid
                # raising exceptions whenever possible since exceptions thrown
                # from 'import portage' or 'import portage.exceptions' statements
index a2c5f778ecd0b35729586f89dd522427470780c6..cfef94e264453dfafff3944207fc203b67b6bc5d 100644 (file)
@@ -48,7 +48,7 @@ class TestFakedbapi(TestCase):
                                "PORTDIR": portdir,
                        }
                        fakedb = fakedbapi(settings=config(config_profile_path="",
-                               env=env, _eprefix=tempdir))
+                               env=env, eprefix=tempdir))
                        for cpv, metadata in packages:
                                fakedb.cpv_inject(cpv, metadata=metadata)