Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9596 - main/branches/2.1.2/bin
Date: Sat, 29 Mar 2008 06:49:58
Message-Id: E1JfUt2-0000pF-33@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-03-29 06:49:55 +0000 (Sat, 29 Mar 2008)
3 New Revision: 9596
4
5 Modified:
6 main/branches/2.1.2/bin/emerge
7 Log:
8 Bug #214691 - Move the "slot collision" display so that it is shown after
9 the merge list where it is most likely to be seen (along with other depgraph
10 problems). (trunk r9584)
11
12
13 Modified: main/branches/2.1.2/bin/emerge
14 ===================================================================
15 --- main/branches/2.1.2/bin/emerge 2008-03-29 05:55:49 UTC (rev 9595)
16 +++ main/branches/2.1.2/bin/emerge 2008-03-29 06:49:55 UTC (rev 9596)
17 @@ -1529,6 +1529,7 @@
18 self._pprovided_args = []
19 self._missing_args = []
20 self._masked_installed = []
21 + self._unsatisfied_deps_for_display = []
22
23 def _show_slot_collision_notice(self):
24 """Show an informational message advising the user to mask one of the
25 @@ -1537,6 +1538,9 @@
26 already been selected) will be required in order to handle all possible
27 cases."""
28
29 + if not self._slot_collision_info:
30 + return
31 +
32 msg = []
33 msg.append("\n!!! Multiple versions within a single " + \
34 "package slot have been \n")
35 @@ -1834,8 +1838,8 @@
36 self._missing_args.append(arg)
37
38 if "selective" not in self.myparams:
39 - self._show_unsatisfied_dep(
40 - myroot, arg, myparent=myparent)
41 + self._unsatisfied_deps_for_display.append(
42 + ((myroot, arg), {"myparent":myparent}))
43 return 0
44
45 pkg = Package(type_name=mytype, root=myroot,
46 @@ -2456,8 +2460,8 @@
47 if not matched_packages:
48 if raise_on_missing:
49 raise portage_exception.PackageNotFound(x)
50 - self._show_unsatisfied_dep(myroot, x,
51 - myparent=myparent)
52 + self._unsatisfied_deps_for_display.append(
53 + ((myroot, x), {"myparent":myparent}))
54 return 0
55
56 if "--debug" in self.myopts:
57 @@ -2747,8 +2751,8 @@
58 # unresolvable blocks.
59 for x in self.altlist():
60 if x[0] == "blocks":
61 + self._slot_collision_info.clear()
62 return True
63 - self._show_slot_collision_notice()
64 if not self._accept_collisions():
65 return False
66 return True
67 @@ -3765,6 +3769,20 @@
68 print bold('*'+revision)
69 sys.stdout.write(text)
70
71 + self.display_problems()
72 + return os.EX_OK
73 +
74 + def display_problems(self):
75 + """
76 + Display problems with the dependency graph such as slot collisions.
77 + This is called internally by display() to show the problems _after_
78 + the merge list where it is most likely to be seen, but if display()
79 + is not going to be called then this method should be called explicitly
80 + to ensure that the user is notified of problems with the graph.
81 + """
82 +
83 + self._show_slot_collision_notice()
84 +
85 if self._pprovided_args:
86 arg_refs = {}
87 for arg_atom in self._pprovided_args:
88 @@ -3801,8 +3819,10 @@
89 msg.append("The best course of action depends on the reason that an offending\n")
90 msg.append("package.provided entry exists.\n\n")
91 sys.stderr.write("".join(msg))
92 - return os.EX_OK
93
94 + for pargs, kwargs in self._unsatisfied_deps_for_display:
95 + self._show_unsatisfied_dep(*pargs, **kwargs)
96 +
97 def calc_changelog(self,ebuildpath,current,next):
98 if ebuildpath == None or not os.path.exists(ebuildpath):
99 return []
100 @@ -6324,6 +6344,10 @@
101 merge_count = 0
102 pretend = "--pretend" in myopts
103 fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts
104 + ask = "--ask" in myopts
105 + tree = "--tree" in myopts
106 + verbose = "--verbose" in myopts
107 + quiet = "--quiet" in myopts
108 if pretend or fetchonly:
109 # make the mtimedb readonly
110 mtimedb.filename = None
111 @@ -6425,6 +6449,7 @@
112 mydepgraph = depgraph(settings, trees, myopts, myparams, spinner)
113 if not mydepgraph.xcreate(myaction):
114 print "!!! Depgraph creation failed."
115 + mydepgraph.display_problems()
116 return 1
117 if "--quiet" not in myopts and "--nodeps" not in myopts:
118 print "\b\b... done!"
119 @@ -6439,9 +6464,14 @@
120 portage.writemsg("\n!!! %s\n" % str(e), noiselevel=-1)
121 return 1
122 if not retval:
123 + mydepgraph.display_problems()
124 return 1
125 if "--quiet" not in myopts and "--nodeps" not in myopts:
126 print "\b\b... done!"
127 + display = pretend or \
128 + ((ask or tree or verbose) and not (quiet and not ask))
129 + if not display:
130 + mydepgraph.display_problems()
131
132 if "--pretend" not in myopts and \
133 ("--ask" in myopts or "--tree" in myopts or \
134
135 --
136 gentoo-commits@l.g.o mailing list