Merged from trunk 11017:11035
| 11018 | Fix a few typos found with pyflakes. Thanks to Cardoe for |
| zmedico | reporting. |
| 11019 | Fix SpawnProcess.start() to return early and notify exit |
| zmedico | listeners if the spawn call fails. |
| 11020 | For subclasses of Task, explicitly assign __hash__ = |
| zmedico | Task.__hash__ for compatibility with python-2.6_beta. Thanks |
| | to Arfrever for reporting. |
| 11021 | * Add a digraph.get() method, analogous to dict.get(), used |
| zmedico | to simplify Scheduler._pkg(). * Define digraph.__contains__ |
| | for containment tests via the "in" operator. |
| 11022 | Create a test case for the poll loop which uses the loop to |
| zmedico | read data from a 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. |
| 11023 | Derive a PtyReaderTestCase from PipeReaderTestCase. This |
| zmedico | test is expected to fail on some operating systems such as |
| | Darwin that do not support poll() on pty devices. |
| 11024 | Split out a portage._create_pty_or_pipe() function to avoid |
| zmedico | duplicate code. |
| 11025 | Implement a runtime test that checks whether it's possible |
| zmedico | to use poll() to 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. |
| 11026 | Set self._mergelist inside Scheduler._calc_resume_list() |
| zmedico | since it needs to be set when calling _set_digraph(). |
| 11027 | Add missing self.wait() calls when tasks return |
| zmedico | unsuccessfully. |
| 11028 | Remember to close file descriptors before returning early |
| zmedico | from can_poll_pty(). |
| 11029 | Rename PollScheduler._schedule() to _schedule_wait(). |
| zmedico | |
| 11030 | * Wrap calls to PollScheduler._schedule_tasks() with a |
| zmedico | _schedule() method 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. |
| 11031 | Decrement the job count prior to merging a given package |
| zmedico | (after it's been built or extracted). This will allow |
| | additional jobs to spawn sooner in some cases when there may |
| | be idle resources. |
| 11032 | Fix Scheduler._schedule_tasks() so that it never schedules a |
| zmedico | task when a package has already failed. |
| 11033 | In order to avoid having BlockerDB instantiate a new |
| zmedico | FakeVartree for each 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. |
| 11034 | Fix broken binpkg path comparison in in binarytree.inject() |
| zmedico | so that duplicate entries are correctly from the Packages |
| | index. |
| 11035 | Changes to pym/_emerge/__init__.py from the previous commit |
| zmedico | weren't meant to be committed yet. |
svn path=/main/branches/prefix/; revision=11036