summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
Commit message (Collapse)AuthorAgeFilesLines
* * Add xterm titles support to Scheduler._display_status().Zac Medico2008-07-161-9/+19
| | | | | | * Tweak emergelog() so that it won't interfere with the scheduler summary. svn path=/main/trunk/; revision=11073
* Add async support for calling functions in misc-functions.sh:Zac Medico2008-07-161-47/+98
| | | | | | | | | | | | | | * Create a new MiscFunctionsProcess class derived from SpawnProcess. * Add "background" support to the SpawnProcess class and split out a _spawn() template function so MiscFunctionsProcess can override it. * Rename the existing EbuildPhase class to EbuildProcess. * Create a new EbuildPhase class derived from CompositeTask. This class spawns the EbuildProcess and MiscFunctionsProcess classes as sub-tasks. svn path=/main/trunk/; revision=11072
* Show LDFLAGS in emerge --info <pkg> output. Thanks to dirtyepic for thisZac Medico2008-07-161-1/+1
| | | | | | patch. svn path=/main/trunk/; revision=11070
* Pass the whole dblink instance into Scheduler._dblink_display_merge() in caseZac Medico2008-07-161-2/+2
| | | | | | it's ever needed. svn path=/main/trunk/; revision=11069
* Adapt the dblink merge display callback to use log levels from the loggingZac Medico2008-07-161-5/+14
| | | | | | | module so that it can be used as an interface for both writemsg() and writemsg_stdout(). svn path=/main/trunk/; revision=11066
* Redirect dblink.unmerge() output to the log file when --jobs > 1.Zac Medico2008-07-161-1/+12
| | | | svn path=/main/trunk/; revision=11065
* When --jobs > 1, display a status message each time thatZac Medico2008-07-161-3/+32
| | | | | | | | | Scheduler._schedule_tasks() is called. For example: >>> Jobs: 2 running, 0 merges, load average: 0.34, 0.46, 0.27 svn path=/main/trunk/; revision=11064
* Add some cross references between emerge's new parallel build options andZac Medico2008-07-151-1/+8
| | | | | | MAKEOPTS. svn path=/main/trunk/; revision=11063
* Make EbuildFetcher copy FETCHCOMMAND and RESUMECOMMAND to the fetchZac Medico2008-07-151-0/+6
| | | | | | environment, in case the default values have been overridden. svn path=/main/trunk/; revision=11062
* In Scheduler._restart_if_necessary(), use list.remove() instead of assumingZac Medico2008-07-151-1/+1
| | | | | | that portage is first in the resume list. svn path=/main/trunk/; revision=11061
* When packages fail with --jobs > 1 and the "echo" elog module is not enabled,Zac Medico2008-07-151-2/+37
| | | | | | | | emulate elog's mod_echo module to show the 'error' level messages, which should include the important die message. This is implemented by adding a private hook inside elog_process() which the scheduler uses to collect error messages. svn path=/main/trunk/; revision=11056
* When there is more than one failure, show a summary packages that failed toZac Medico2008-07-151-8/+31
| | | | | | | build or install. This is especially useful when using --jobs or --keep-going since there can be multiple failures. svn path=/main/trunk/; revision=11055
* * Fix --keep-going breakage that occured when Scheduler._choose_pkg() wasZac Medico2008-07-151-17/+11
| | | | | | | | | | | | | introduced. * Handle multiple failed builds when buildinding in parallel. * Fix Scheduler._do_merge_exit() to remove the correct package since it's not always at position 0 when using --jobs. in parallel, so svn path=/main/trunk/; revision=11054
* Make AsynchronousTask "registered" attributes private since poll() and wait()Zac Medico2008-07-151-32/+32
| | | | | | | do the job now. Also, hide SubProcess.files since there's no reason to expose it. svn path=/main/trunk/; revision=11053
* Use self.registered to return early from SubProcess.poll() when possible,Zac Medico2008-07-151-2/+2
| | | | | | | and remove the related code from SequentialTaskQueue.schedule() since this makes it obsolete. svn path=/main/trunk/; revision=11052
* Add a PollScheduler._next_poll_event() method to maintain a central eventZac Medico2008-07-151-11/+25
| | | | | | | | | queue between _poll_loop() and _schedule_wait(). This solves an intermittent KeyError from _poll_loop() which occured when an event handler called _schedule_wait() which unregistered an event handler for an event that _poll_loop() had already recieved but hadn't processed yet. svn path=/main/trunk/; revision=11051
* Split out a _main_loop_cleanup() method from Scheduler._merge() and call itZac Medico2008-07-151-6/+9
| | | | | | | before restarting in _restart_if_necessary() to kill any parallel-fetch tasks that may still be running. svn path=/main/trunk/; revision=11050
* Split out a generic SubProcess._unregister() method that's called fromZac Medico2008-07-141-44/+54
| | | | | | | | | _wait() to make sure everything is cleaned up before wait() returns. This might solve an intermittent KeyError that is sometimes raised from the main poll() loop when a handler is no longer registered for a poll() event that has occurred. svn path=/main/trunk/; revision=11049
* Unregister from poll() objects before closing file in order to hopefullyZac Medico2008-07-141-17/+24
| | | | | | | avoid stale events that can trigger a KeyError in Scheduler._poll_loop() if the event's file descriptor no longer has a registered handler. svn path=/main/trunk/; revision=11047
* * Fix doebuild so "returnpid" works for preinst and postinst.Zac Medico2008-07-141-11/+39
| | | | | | | | | * Add async support for pkg_prerm and pkg_postrm. * Add missing "treetype" parameter to dblink constructor calls. * Fix SubProcess._wait() to check self.returncode _after_ calling the scheduler. svn path=/main/trunk/; revision=11045
* Add async execution support for pkg_preinst and pkg_postinst. This allows theZac Medico2008-07-141-8/+69
| | | | | | | scheduler's poll loop to run so that other parallel tasks aren't starved for output handling while pkg_preinst and pkg_postinst are executing. svn path=/main/trunk/; revision=11044
* Remove redundant failed_packages check from Scheduler._main_loop() sinceZac Medico2008-07-131-2/+1
| | | | | | it's now handled inside the _schedule() call. svn path=/main/trunk/; revision=11043
* Ensure that that Scheduler._main_loop() doesn't return before the mergeZac Medico2008-07-131-1/+3
| | | | | | queue is empty. svn path=/main/trunk/; revision=11042
* Remove all traces of the "poll" parameter for the PollScheduler constructorZac Medico2008-07-131-8/+6
| | | | | | since it was only used by can_poll_pty(). svn path=/main/trunk/; revision=11040
* * Since can_poll_pty() is unsafe due to he possibility of the poll() callZac Medico2008-07-131-42/+27
| | | | | | | | | blocking forever, replace it with a simpler test on /dev/null that's derived from a test in a glib2 configure script. * Remove PtyReaderTestCase since it has the same problem as can_poll_pty(). svn path=/main/trunk/; revision=11039
* In can_poll_tty(), direct bash's stderr into the pty since we don't wantZac Medico2008-07-131-1/+1
| | | | | | | | | so see any error message it generates (due to PipeReader closing it's end of the pty). The error message is irrelevant since all we want to know is whether or not the data is successfully transmitted through the pty. svn path=/main/trunk/; revision=11037
* Changes to pym/_emerge/__init__.py from the previous commit weren't meantZac Medico2008-07-131-21/+3
| | | | | | to be committed yet. svn path=/main/trunk/; revision=11035
* Fix broken binpkg path comparison in in binarytree.inject() so that duplicateZac Medico2008-07-131-3/+21
| | | | | | entries are correctly from the Packages index. svn path=/main/trunk/; revision=11034
* In order to avoid having BlockerDB instantiate a new FakeVartree for eachZac Medico2008-07-131-9/+110
| | | | | | | | merge, add a FakeVartree.sync() method and so that the same FakeVartree can be reused. Package counters and timestamps are used to validate package instances during each sync() call. svn path=/main/trunk/; revision=11033
* Fix Scheduler._schedule_tasks() so that it never schedules a task when aZac Medico2008-07-131-1/+1
| | | | | | package has already failed. svn path=/main/trunk/; revision=11032
* Decrement the job count prior to merging a given package (after it's beenZac Medico2008-07-131-9/+7
| | | | | | | built or extracted). This will allow additional jobs to spawn sooner in some cases when there may be idle resources. svn path=/main/trunk/; revision=11031
* * Wrap calls to PollScheduler._schedule_tasks() with a _schedule() methodZac Medico2008-07-121-5/+25
| | | | | | | | | | | | | | | that automatically returns early from any recursive calls that the _schedule_tasks() call might trigger. This makes _schedule() safe to call from inside exit listeners. * Call _schedule() inside Scheduler._job_exit() to trigger a new job when possible. * Fix SequentialTaskQueue._task_exit() to avoid a potential KeyError if the task had already been removed from self.running_tasks for some reason. svn path=/main/trunk/; revision=11030
* Rename PollScheduler._schedule() to _schedule_wait().Zac Medico2008-07-121-4/+4
| | | | svn path=/main/trunk/; revision=11029
* Remember to close file descriptors before returning early from can_poll_pty().Zac Medico2008-07-121-0/+2
| | | | svn path=/main/trunk/; revision=11028
* Add missing self.wait() calls when tasks return unsuccessfully.Zac Medico2008-07-121-2/+8
| | | | svn path=/main/trunk/; revision=11027
* Set self._mergelist inside Scheduler._calc_resume_list() since it needs toZac Medico2008-07-121-5/+6
| | | | | | be set when calling _set_digraph(). svn path=/main/trunk/; revision=11026
* Implement a runtime test that checks whether it's possible to use poll() toZac Medico2008-07-121-9/+69
| | | | | | | | | | | read data from a pty device. The test only runs the first time that the can_poll_pty() function is called (currently happens when the first PollScheduler instance is created). The test is known to fail on Darwin and we're not sure how many other kernels might have a similar problem, this runtime test allows us to avoid having to maintain special cases for various kernels. svn path=/main/trunk/; revision=11025
* Split out a portage._create_pty_or_pipe() function to avoid duplicate code.Zac Medico2008-07-121-25/+2
| | | | svn path=/main/trunk/; revision=11024
* Derive a PtyReaderTestCase from PipeReaderTestCase. This test is expected toZac Medico2008-07-121-2/+12
| | | | | | | fail on some operating systems such as Darwin that do not support poll() on pty devices. svn path=/main/trunk/; revision=11023
* Create a test case for the poll loop which uses the loop to read data from aZac Medico2008-07-121-41/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | pipe and assert that the data written to the pipe is identical to the data read from the pipe. In order to implement this test, several useful classes have been added: * PipeReader Reads output from one or more files and saves it in memory, for retrieval via the getvalue() method. This is driven by the scheduler's poll() loop, so it runs entirely within the current process. * QueueScheduler Add instances of SequentialTaskQueue and then call run(). The run() method returns when no tasks remain. * TaskScheduler A simple way to handle scheduling of AsynchrousTask instances. Simply add tasks and call run(). The run() method returns when no tasks remain. svn path=/main/trunk/; revision=11022
* * Add a digraph.get() method, analogous to dict.get(), used to simplifyZac Medico2008-07-121-6/+3
| | | | | | | | Scheduler._pkg(). * Define digraph.__contains__ for containment tests via the "in" operator. svn path=/main/trunk/; revision=11021
* For subclasses of Task, explicitly assign __hash__ = Task.__hash__ forZac Medico2008-07-121-0/+5
| | | | | | compatibility with python-2.6_beta. Thanks to Arfrever for reporting. svn path=/main/trunk/; revision=11020
* Fix SpawnProcess.start() to return early and notify exit listeners if theZac Medico2008-07-111-1/+10
| | | | | | spawn call fails. svn path=/main/trunk/; revision=11019
* Call settings.reset() in EbuildMetadataPhase.start() since that's whatZac Medico2008-07-111-0/+1
| | | | | | | | portdbapi does too before generating metadata, and without it, a previous CATEGORY can leak into the ebuild env and corrupt it (breaks lots of packages that reference $CATEGORY). svn path=/main/trunk/; revision=11015
* Document the new --jobs and --load-average options for parallelization.Zac Medico2008-07-111-4/+24
| | | | svn path=/main/trunk/; revision=11014
* Refactor and simplify the main task scheduling and poll loops:Zac Medico2008-07-111-94/+74
| | | | | | | | | | | | | | * Make output handlers unregister themselves and call wait() to notify exit listeners immediately. This makes the exit listeners more useful for scheduling tasks. This makes the poll loop nice an clean because it just calls the handlers and then the handlers can do the scheduling when necessary. * Make SequentialTaskQueue.add() and addFront() trigger scheduling internally, so that it's more of a chain reaction than something that has to be done explicitly. svn path=/main/trunk/; revision=11013
* Add support for parallel --regen, using the existing --jobs and --load-averageZac Medico2008-07-101-135/+326
| | | | | | | | | | | | | | | | options: * Split out a PollLoop base class from Scheduler and derive a MetadataRegen class to handle parallel scheduling for --regen. * Add pordbapi._metadata_process() and _metadata_callback() methods to implement asynchronous metadata generation. One method returns an EbuildMetadataPhase instance to encapsulate the async task. The other method is called to save the metadata when the process completes successfully. These methods share code with aux_get to avoid duplicate code. svn path=/main/trunk/; revision=11012
* When a package replaces another one, add the corresponding uninstall taskZac Medico2008-07-101-1/+19
| | | | | | | for the replaced package to Scheduler._completed_tasks so that it's properly accounted for in _dependent_on_scheduled_merges(). svn path=/main/trunk/; revision=11011
* * Fix AsynchronousTask._wait_hook() to prevent potential recursive callsZac Medico2008-07-101-2/+22
| | | | | | | | | | | triggered when calling exit listeners. * Make SequentialTaskQueue use exit listeners to trigger scheduling as soon as a task exits. This makes it possible for the queues to automatically schedule new tasks while scheduler remains in it's poll() loop. svn path=/main/trunk/; revision=11008
* * Handle errno.ECHILD and errno.ESRCH from waitpid() and kill() calls. TheseZac Medico2008-07-101-4/+28
| | | | | | | | | errors commonly occur when ^C is used to kill emerge. * Remove spawned pids from portage.process.spawned_pids immediately in order to avoid a race condition for removing it. svn path=/main/trunk/; revision=11007