From: Fabian Groffen Date: Mon, 29 Aug 2011 18:56:30 +0000 (+0200) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5b6156b085ab5ae518fa6c4ed9b2e2c5b75fd184;p=portage.git Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/dispatch-conf bin/repoman pym/portage/__init__.py pym/portage/tests/runTests pym/portage/util/env_update.py runtests.sh --- 5b6156b085ab5ae518fa6c4ed9b2e2c5b75fd184 diff --cc bin/dispatch-conf index 6ce255ed5,497927df4..fe85c54d6 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python -O +#!@PREFIX_PORTAGE_PYTHON@ -O - # Copyright 1999-2006 Gentoo Foundation + # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # diff --cc bin/repoman index d58c52faf,d9ecfc469..ed62fa112 --- a/bin/repoman +++ b/bin/repoman @@@ -99,7 -96,8 +99,10 @@@ os.umask(0o22 # behave incrementally. repoman_incrementals = tuple(x for x in \ portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS') - repoman_settings = portage.config(local_config=False, _eprefix=EPREFIX) + eprefix = os.environ.get("__REPOMAN_TEST_EPREFIX") ++if not eprefix: ++ eprefix = EPREFIX + repoman_settings = portage.config(local_config=False, _eprefix=eprefix) repoman_settings.lock() if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \ diff --cc pym/portage/__init__.py index 4ce9efe25,72cdf2dbb..8b5426b51 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@@ -473,8 -472,9 +473,11 @@@ def create_trees(config_root=None, targ portdbapi.portdbapi_instances.remove(portdb) del trees[myroot]["porttree"], myroot, portdb + eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX") ++ if not eprefix: ++ eprefix = EPREFIX settings = config(config_root=config_root, target_root=target_root, - config_incrementals=portage.const.INCREMENTALS, _eprefix=EPREFIX) + config_incrementals=portage.const.INCREMENTALS, _eprefix=eprefix) settings.lock() myroots = [(settings["ROOT"], settings)] diff --cc pym/portage/data.py index 0c0e32010,c496c0b92..354fc9c6e --- a/pym/portage/data.py +++ b/pym/portage/data.py @@@ -67,8 -63,11 +67,11 @@@ secpass= uid=os.getuid() wheelgid=0 -if uid==0: +if uid==rootuid: secpass=2 + elif "__PORTAGE_TEST_EPREFIX" in os.environ: + secpass = 2 + try: wheelgid=grp.getgrnam("wheel")[2] except KeyError: diff --cc pym/portage/util/env_update.py index 2650f1523,173166351..d4f378736 --- a/pym/portage/util/env_update.py +++ b/pym/portage/util/env_update.py @@@ -47,8 -46,13 +46,15 @@@ def env_update(makelinks=1, target_root if prev_mtimes is None: prev_mtimes = portage.mtimedb["ldpath"] if env is None: - env = os.environ - envd_dir = os.path.join(target_root, EPREFIX_LSTRIP, "etc", "env.d") + settings = os.environ ++ if 'EPREFIX' not in settings: ++ settings['EPREFIX'] = portage.const.EPREFIX + else: + settings = env + + eprefix = settings.get("EPREFIX", "") + eprefix_lstrip = eprefix.lstrip(os.sep) + envd_dir = os.path.join(target_root, eprefix_lstrip, "etc", "env.d") ensure_dirs(envd_dir, mode=0o755) fns = listdir(envd_dir, EmptyOnError=1) fns.sort() @@@ -279,12 -271,12 +273,12 @@@ penvnotice = "# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.\n" penvnotice += "# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES\n" cenvnotice = penvnotice[:] - penvnotice += "# GO INTO " + EPREFIX + "/etc/profile NOT /etc/profile.env\n\n" - cenvnotice += "# GO INTO " + EPREFIX + "/etc/csh.cshrc NOT /etc/csh.env\n\n" - penvnotice += "# GO INTO /etc/profile NOT /etc/profile.env\n\n" - cenvnotice += "# GO INTO /etc/csh.cshrc NOT /etc/csh.env\n\n" ++ penvnotice += "# GO INTO " + eprefix + "/etc/profile NOT /etc/profile.env\n\n" ++ cenvnotice += "# GO INTO " + eprefix + "/etc/csh.cshrc NOT /etc/csh.env\n\n" #create /etc/profile.env for bash support - outfile = atomic_ofstream(os.path.join(target_root, EPREFIX_LSTRIP, "etc", "profile.env")) + outfile = atomic_ofstream(os.path.join( + target_root, eprefix_lstrip, "etc", "profile.env")) outfile.write(penvnotice) env_keys = [ x for x in env if x != "LDPATH" ] diff --cc runtests.sh index dadd32db1,981fa1ec2..52f7bb076 --- a/runtests.sh +++ b/runtests.sh @@@ -26,9 -26,9 +26,9 @@@ trap interrupted SIGIN exit_status="0" for version in ${PYTHON_VERSIONS}; do - if [[ -x /usr/bin/python${version} ]]; then + if [[ -x @PREFIX_PORTAGE_PYTHON@${version} ]]; then echo -e "${GOOD}Testing with Python ${version}...${NORMAL}" - if ! @PREFIX_PORTAGE_PYTHON@${version} pym/portage/tests/runTests "$@" ; then - if ! /usr/bin/python${version} -Wd pym/portage/tests/runTests "$@" ; then ++ if ! @PREFIX_PORTAGE_PYTHON@${version} -Wd pym/portage/tests/runTests "$@" ; then echo -e "${BAD}Testing with Python ${version} failed${NORMAL}" exit_status="1" fi