From 060c3025238ac8e54d4903ee05752a00862e62c1 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Thu, 14 Aug 2008 19:16:02 +0000 Subject: [PATCH] Merged from trunk 11391:11399 | 11392 | Remove unnecessary dict.keys() call. | | zmedico | | | 11393 | When testing userpriv write access in $DISTDIR, redirect the | | zmedico | 'permission denied' error message to /dev/null. | | 11394 | For pkg_config and pkg_info, add respective "config" and | | zmedico | "info" values to EBUILD_PHASES. | | 11395 | Increase Scheduler._job_delay_max to 10 seconds. | | zmedico | | | 11397 | In source_all_bashrcs(), only change $IFS while splitting | | zmedico | $PROFILE_PATHS into an array, and then restore it before | | | doing anything else. This avoids interference that can | | | otherwise occur if code from profile.bashrc (or | | | /etc/portage/env, be extension) needs to call any of the | | | elog functions which use the save_IFS and restore_IFS | | | aliases internally. | | 11398 | Entirely disable the src_configure phase from the python | | zmedico | side for EAPI values for which it's not supported. This | | | avoids pointless spawning of ebuild.sh and also avoids | | | having bashrc called during an invalid phase as reported by | | | Arfrever. | | 11399 | Fix ebuild(1) so that src_configure is only called for EAPIs | | zmedico | for which it is supported. | svn path=/main/branches/prefix/; revision=11408 --- bin/ebuild.sh | 13 ++++--------- pym/_emerge/__init__.py | 13 ++++++++++--- pym/portage/__init__.py | 8 +++++++- pym/portage/const.py | 2 +- pym/portage/dbapi/vartree.py | 2 +- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 688204270..7119fcdd3 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -866,10 +866,6 @@ abort_install() { } dyn_configure() { - # PREFIX HACK: just remove "prefix" from EAPI here, this file - # currently assumes EAPI to contain a single token, and "prefix" - # is ortogonal to all supported EAPIs here. - hasq ${EAPI/prefix/} 0 1 2_pre1 && return 0 if [[ $PORTAGE_BUILDDIR/.configured -nt $WORKDIR ]] ; then vecho ">>> It appears that '$PF' is already configured; skipping." @@ -1529,13 +1525,12 @@ source_all_bashrcs() { # source the existing profile.bashrc's. save_IFS IFS=$'\n' - for x in ${PROFILE_PATHS}; do - # Must unset it so that it doesn't mess up assumptions in the RCs. - unset IFS + local path_array=($PROFILE_PATHS) + restore_IFS + for x in ${path_array[@]} ; do [ -f "${x}/profile.bashrc" ] && qa_source "${x}/profile.bashrc" done - restore_IFS - + # We assume if people are changing shopts in their bashrc they do so at their # own peril. This is the ONLY non-portage bit of code that can change shopts # without a QA violation. diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 2ef7ceaae..e2cc67160 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -77,7 +77,7 @@ portage.dep._dep_check_strict = True import portage.util import portage.locks import portage.exception -from portage.const import EPREFIX, BPREFIX, EPREFIX_LSTRIP +from portage.const import EPREFIX, BPREFIX, EPREFIX_LSTRIP, EAPIPREFIX from portage.data import secpass from portage.elog.messages import eerror from portage.util import normalize_path as normpath @@ -2684,7 +2684,14 @@ class EbuildExecuter(CompositeTask): ebuild_phases = TaskSequence(scheduler=self.scheduler) - for phase in self._phases: + pkg = self.pkg + phases = self._phases + EAPIPREFIX + if pkg.metadata["EAPI"].replace(EAPIPREFIX, "").strip() in ("0", "1", "2_pre1"): + # skip src_configure + phases = phases[1:] + + for phase in phases: ebuild_phases.add(EbuildPhase(background=self.background, pkg=self.pkg, phase=phase, scheduler=self.scheduler, settings=self.settings, tree=self._tree)) @@ -8921,7 +8928,7 @@ class Scheduler(PollScheduler): # The load average takes some time to respond when new # jobs are added, so we need to limit the rate of adding # new jobs. - self._job_delay_max = 5 + self._job_delay_max = 10 self._job_delay_factor = 1.0 self._job_delay_exp = 1.5 self._previous_job_start_time = None diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 4f20ae592..260f38680 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -3221,7 +3221,7 @@ def _spawn_fetch(settings, args, **kwargs): return rval _userpriv_test_write_file_cache = {} -_userpriv_test_write_cmd_script = "> %(file_path)s ; rval=$? ; " + \ +_userpriv_test_write_cmd_script = "touch %(file_path)s 2>/dev/null ; rval=$? ; " + \ "rm -f %(file_path)s ; exit $rval" def _userpriv_test_write_file(settings, file_path): @@ -4335,6 +4335,10 @@ def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0, fd_pipes=fd_pipes, returnpid=returnpid) if retval: return retval + + if mydo == "configure" and mysettings["EAPI"] in ("0", "1", "2_pre1"): + return os.EX_OK + kwargs = actionmap[mydo]["args"] mysettings["EBUILD_PHASE"] = mydo _doebuild_exit_status_unlink( @@ -4707,6 +4711,8 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m if not eapi_is_supported(eapi): # can't do anything with this. raise portage.exception.UnsupportedAPIException(mycpv, eapi) + mysettings.pop("EAPI", None) + mysettings.configdict["pkg"]["EAPI"] = eapi try: mysettings["PORTAGE_RESTRICT"] = " ".join(flatten( portage.dep.use_reduce(portage.dep.paren_reduce( diff --git a/pym/portage/const.py b/pym/portage/const.py index 46f597c38..51a123e86 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -82,7 +82,7 @@ INCREMENTALS = ["USE", "USE_EXPAND", "USE_EXPAND_HIDDEN", "FEATURES", EBUILD_PHASES = ["setup", "unpack", "configure", "compile", "test", "install", "package", "preinst", "postinst","prerm", "postrm", - "nofetch", "other"] + "nofetch", "config", "info", "other"] EAPI = 1 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 78eb91115..9a5d6d4f3 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -343,7 +343,7 @@ class LinkageMap(object): if not self._libs: self.rebuild() # Iterate over all binaries within LinkageMap. - for obj in self._obj_properties.keys(): + for obj in self._obj_properties: rValue.setdefault(obj, self.findProviders(obj)) return rValue -- 2.26.2