-#!/usr/bin/python
+#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 2010 Gentoo Foundation
+ # Copyright 2010-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import os
-#!/usr/bin/python
+#!@PREFIX_PORTAGE_PYTHON@
- # Copyright 2009 Gentoo Foundation
+ # Copyright 2009-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import optparse
from portage import subprocess_getstatusoutput
from portage import _unicode_decode
from portage.cache.cache_errors import CacheError
- from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH, EPREFIX
-from portage.const import GLOBAL_CONFIG_PATH
++from portage.const import GLOBAL_CONFIG_PATH, EPREFIX
from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG
from portage.dbapi.dep_expand import dep_expand
from portage.dbapi._expand_new_virt import expand_new_virt
portdbapi.portdbapi_instances.remove(portdb)
del trees[myroot]["porttree"], myroot, portdb
- eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX")
+ if trees is None:
+ trees = _trees_dict()
+ elif not isinstance(trees, _trees_dict):
+ # caller passed a normal dict or something,
+ # but we need a _trees_dict instance
+ trees = _trees_dict(trees)
+
+ if env is None:
+ env = os.environ
+ eprefix = env.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)
+ env=env, _eprefix=eprefix)
settings.lock()
- myroots = [(settings["ROOT"], settings)]
- if settings["ROOT"] != "/":
+ trees._target_eroot = settings['EROOT']
+ myroots = [(settings['EROOT'], settings)]
+ if settings["ROOT"] == "/":
+ trees._running_eroot = trees._target_eroot
+ else:
# When ROOT != "/" we only want overrides from the calling
# environment to apply to the config that's associated
'portage.util.listdir:dircache,listdir',
'portage.util._dyn_libs.PreservedLibsRegistry:PreservedLibsRegistry',
'portage.util._dyn_libs.LinkageMapELF:LinkageMapELF@LinkageMap',
+ 'portage.util._dyn_libs.LinkageMapMachO:LinkageMapMachO',
+ 'portage.util._dyn_libs.LinkageMapPeCoff:LinkageMapPeCoff',
+ 'portage.util._dyn_libs.LinkageMapXCoff:LinkageMapXCoff',
'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,pkgcmp,' + \
'_pkgsplit@pkgsplit',
+ 'tarfile',
)
from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, \
#to allow profiles to override masks from their parent profiles.
profile_pkgmasklines = []
profile_pkgunmasklines = []
- for x in profiles:
+ # PREFIX LOCAL: Prefix has unmasks for stuff in profiles/package.mask
+ # If we don't consider the repomasks here, those unmasks are
+ # lost, causing lots of issues (e.g. Portage being masked)
+ # for minimal/concentrated code change, empty repo_pkgmasklines here
+ # such that they don't count double
+ repo_pkgmasklines = []
+ repo_pkgunmasklines = []
+ all_profiles = []
+ for repo in repositories.repos_with_profiles():
+ all_profiles.append(os.path.join(repo.location, "profiles"))
+ all_profiles.extend(profiles)
+ for x in all_profiles:
profile_pkgmasklines.append(grabfile_package(
- os.path.join(x, "package.mask"), recursive=1, remember_source_file=True, verify_eapi=True))
- profile_pkgunmasklines.append(grabfile_package(
- os.path.join(x, "package.unmask"), recursive=1, remember_source_file=True, verify_eapi=True))
+ os.path.join(x.location, "package.mask"),
+ recursive=x.portage1_directories,
+ remember_source_file=True, verify_eapi=True))
+ if x.portage1_directories:
+ profile_pkgunmasklines.append(grabfile_package(
+ os.path.join(x.location, "package.unmask"),
+ recursive=x.portage1_directories,
+ remember_source_file=True, verify_eapi=True))
profile_pkgmasklines = stack_lists(profile_pkgmasklines, incremental=1, \
remember_source_file=True, warn_for_unmatched_removal=True,
strict_warn_for_unmatched_removal=strict_umatched_removal)
trap interrupted SIGINT
+ unused_args=()
+
+ while [[ -n $1 ]] ; do
+ case "$1" in
+ --python-versions=*)
+ PYTHON_VERSIONS=${1#--python-versions=}
+ ;;
+ --python-versions)
+ shift
+ PYTHON_VERSIONS=$1
+ ;;
+ *)
+ unused_args[${#unused_args[@]}]=$1
+ ;;
+ esac
+ shift
+ done
+
+ set -- "${unused_args[@]}"
+
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 ! /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