Merged from trunk 11017:11035
authorFabian Groffen <grobian@gentoo.org>
Sun, 13 Jul 2008 11:28:59 +0000 (11:28 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 13 Jul 2008 11:28:59 +0000 (11:28 -0000)
commit4d4b89ed3852c88a8642c6452a6a8e1addd49d95
tree2eb9a9bbdc0b1e169a1ee594b97ee0cf578e707a
parentb4abbaed2c6f6eaa6a83c26c5499fed3f90f2365
   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
pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/bintree.py
pym/portage/tests/process/__init__.py [new file with mode: 0644]
pym/portage/tests/process/__test__ [new file with mode: 0644]
pym/portage/tests/process/test_poll.py [new file with mode: 0644]
pym/repoman/utilities.py