1 |
Author: zmedico |
2 |
Date: 2008-07-30 08:45:44 +0000 (Wed, 30 Jul 2008) |
3 |
New Revision: 11282 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
* Fix Scheduler._restart_if_necessary() breakage so that the given package |
9 |
is correctly compared to the last one in the merge list. |
10 |
* Update code in depgraph.display() to be more consistent with the code |
11 |
in Scheduler._is_restart_necessary(). |
12 |
|
13 |
|
14 |
Modified: main/trunk/pym/_emerge/__init__.py |
15 |
=================================================================== |
16 |
--- main/trunk/pym/_emerge/__init__.py 2008-07-30 06:12:19 UTC (rev 11281) |
17 |
+++ main/trunk/pym/_emerge/__init__.py 2008-07-30 08:45:44 UTC (rev 11282) |
18 |
@@ -4056,6 +4056,8 @@ |
19 |
if settings.get("PORTAGE_DEBUG", "") == "1": |
20 |
self.edebug = 1 |
21 |
self.spinner = spinner |
22 |
+ self._running_root = trees["/"]["root_config"] |
23 |
+ self._opts_no_restart = Scheduler._opts_no_restart |
24 |
self.pkgsettings = {} |
25 |
# Maps slot atom to package for each Package added to the graph. |
26 |
self._slot_pkg_map = {} |
27 |
@@ -6111,7 +6113,7 @@ |
28 |
node in scheduled_uninstalls)] |
29 |
|
30 |
# sys-apps/portage needs special treatment if ROOT="/" |
31 |
- running_root = "/" |
32 |
+ running_root = self._running_root.root |
33 |
from portage.const import PORTAGE_PACKAGE_ATOM |
34 |
runtime_deps = InternalPackageSet( |
35 |
initial_atoms=[PORTAGE_PACKAGE_ATOM]) |
36 |
@@ -7315,23 +7317,23 @@ |
37 |
myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd |
38 |
p.append(myprint) |
39 |
|
40 |
- mysplit = [portage.cpv_getkey(pkg_key)] + \ |
41 |
- list(portage.catpkgsplit(pkg_key)[2:]) |
42 |
- if "--tree" not in self.myopts and mysplit and \ |
43 |
- len(mysplit) == 3 and mysplit[0] == "sys-apps/portage" and \ |
44 |
- x[1] == "/": |
45 |
- |
46 |
- if mysplit[2] == "r0": |
47 |
- myversion = mysplit[1] |
48 |
+ if "--tree" not in self.myopts and \ |
49 |
+ "--quiet" not in self.myopts and \ |
50 |
+ not self._opts_no_restart.intersection(self.myopts) and \ |
51 |
+ pkg.root == self._running_root.root and \ |
52 |
+ portage.match_from_list( |
53 |
+ portage.const.PORTAGE_PACKAGE_ATOM, [pkg]): |
54 |
+ |
55 |
+ pn, ver, rev = pkg.pv_split |
56 |
+ if rev == "r0": |
57 |
+ myversion = ver |
58 |
else: |
59 |
- myversion = "%s-%s" % (mysplit[1], mysplit[2]) |
60 |
- |
61 |
+ myversion = "%s-%s" % (ver, rev) |
62 |
+ |
63 |
if myversion != portage.VERSION and "--quiet" not in self.myopts: |
64 |
if mylist_index < len(mylist) - 1: |
65 |
p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,")) |
66 |
p.append(colorize("WARN", " then resume the merge.")) |
67 |
- print |
68 |
- del mysplit |
69 |
|
70 |
for x in p: |
71 |
print x |
72 |
@@ -9280,7 +9282,7 @@ |
73 |
if not self._is_restart_necessary(pkg): |
74 |
return |
75 |
|
76 |
- if self._pkg_count.curval >= self._pkg_count.maxval: |
77 |
+ if pkg == self._mergelist[-1]: |
78 |
return |
79 |
|
80 |
self._main_loop_cleanup() |