Merged from trunk 11391:11399
authorFabian Groffen <grobian@gentoo.org>
Thu, 14 Aug 2008 19:16:02 +0000 (19:16 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 14 Aug 2008 19:16:02 +0000 (19:16 -0000)
   | 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
pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/const.py
pym/portage/dbapi/vartree.py

index 68820427025e50aebeaa537758ba75341973d9ee..7119fcdd33092af5baa0db665acde97bf790a718 100755 (executable)
@@ -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.
index 2ef7ceaae73b599f25e60567acb24e430b3b0d7f..e2cc671608c33d58014300756ae19c29dda55c33 100644 (file)
@@ -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
index 4f20ae592f8a04f9d4af874a567ccea08d42d14a..260f38680fda45eff55afcbd7c7cd500877f6fdd 100644 (file)
@@ -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(
index 46f597c38875d956ba1ef76f82bf3d82b25955b5..51a123e865a1e587fab90bdf62bb1ec78ec995dd 100644 (file)
@@ -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
 
index 78eb91115f101a43ea805b68c16e04043b4f553a..9a5d6d4f349167d40b798a46f8fdbbe8fd8b16fb 100644 (file)
@@ -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