Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12035 - in main/branches/prefix: bin man pym/_emerge pym/portage pym/portage/dbapi
Date: Sat, 22 Nov 2008 11:27:02
Message-Id: E1L3qdg-0001lg-Ah@stork.gentoo.org
1 Author: grobian
2 Date: 2008-11-22 11:26:59 +0000 (Sat, 22 Nov 2008)
3 New Revision: 12035
4
5 Modified:
6 main/branches/prefix/bin/repoman
7 main/branches/prefix/man/repoman.1
8 main/branches/prefix/pym/_emerge/__init__.py
9 main/branches/prefix/pym/portage/dbapi/bintree.py
10 main/branches/prefix/pym/portage/news.py
11 Log:
12 Merged from trunk -r11947:11964
13
14 | 11948 | Bug #246853 - Redirect all ouput from |
15 | zmedico | depgraph.display_problems() to stderr. |
16
17 | 11949 | Make depgraph.display_problems() send unsatisfied dependency |
18 | zmedico | ouput to stdout, for parsing by programs such as autounmask. |
19
20 | 11951 | Bug #246821 - Avoid TypeError from binarytree.isremote() by |
21 | zmedico | returning early if self._remotepkgs is None due to |
22 | | PORTAGE_BINHOST being unset. |
23
24 | 11953 | Check the return value from depgraph._add_pkg() when adding |
25 | zmedico | library consumers inside action_depclean(). |
26
27 | 11954 | Inside depgraph._add_pkg(), handle the case where multiple |
28 | zmedico | different instances of the same version (typically one |
29 | | installed and another not yet installed) have been pulled |
30 | | into the graph due to a USE dependency. The "slot collision" |
31 | | display is not helpful in a case like this, so display it as |
32 | | an unsatisfied dependency. Thanks to Peter Volkov <pva@g.o> |
33 | | for reporting. |
34
35 | 11956 | Make NewsManager.updateItems() and getUnreadItems() return |
36 | zmedico | early if PermissionDenied errors are encountered when |
37 | | attempting to read the skip or unread files. |
38
39 | 11958 | Fix logic inside PollScheduler._can_add_job() so that load |
40 | zmedico | average is properly considered when a single job is running. |
41
42 | 11960 | When a "slot conflict" occurs due to USE dependencies, |
43 | zmedico | display the usual slot conflict output together with the |
44 | | unsatisfied USE dependency output, since both might be |
45 | | useful. |
46
47 | 11962 | In order to reduce time consumed for dependency checks, skip |
48 | zmedico | 'dev' profiles by default and add an --include-dev option |
49 | | which causes them to be checked. Given the current |
50 | | profiles.desc content, this approximately halves the number |
51 | | of profiles checked by default and also halves the time |
52 | | consumed by repoman. Thanks to Donnie Berkholz |
53 | | <dberkholz@g.o> for the suggestion. |
54
55 | 11964 | Add a short -d option for the new --include-dev option. |
56 | zmedico | Thanks to Joshua Kinard <kumba@g.o> for the suggestion. |
57
58
59 Modified: main/branches/prefix/bin/repoman
60 ===================================================================
61 --- main/branches/prefix/bin/repoman 2008-11-22 09:19:48 UTC (rev 12034)
62 +++ main/branches/prefix/bin/repoman 2008-11-22 11:26:59 UTC (rev 12035)
63 @@ -191,6 +191,9 @@
64 parser.add_option('-I', '--ignore-masked', dest='ignore_masked', action='store_true',
65 default=False, help='ignore masked packages (not allowed with commit mode)')
66
67 + parser.add_option('-d', '--include-dev', dest='include_dev', action='store_true',
68 + default=False, help='include dev profiles in dependency checks')
69 +
70 parser.add_option('--without-mask', dest='without_mask', action='store_true',
71 default=False, help='behave as if no package.mask entries exist (not allowed with commit mode)')
72
73 @@ -1453,7 +1456,8 @@
74
75 for prof in profiles[arch]:
76
77 - if prof[1] not in ("stable", "dev"):
78 + if prof[1] not in ("stable", "dev") or \
79 + prof[1] == "dev" and not options.include_dev:
80 continue
81
82 profdir = portdir+"/profiles/"+prof[0]
83
84 Modified: main/branches/prefix/man/repoman.1
85 ===================================================================
86 --- main/branches/prefix/man/repoman.1 2008-11-22 09:19:48 UTC (rev 12034)
87 +++ main/branches/prefix/man/repoman.1 2008-11-22 11:26:59 UTC (rev 12035)
88 @@ -37,6 +37,9 @@
89 \fB\-I\fR, \fB\-\-ignore\-masked\fR
90 Ignore masked packages (not allowed with commit mode)
91 .TP
92 +\fB\-d\fR, \fB\-\-include\-dev\fR
93 +Include dev profiles in dependency checks.
94 +.TP
95 \fB\-\-without\-mask\fR
96 Behave as if no package.mask entries exist (not allowed with commit mode)
97 .TP
98
99 Modified: main/branches/prefix/pym/_emerge/__init__.py
100 ===================================================================
101 --- main/branches/prefix/pym/_emerge/__init__.py 2008-11-22 09:19:48 UTC (rev 12034)
102 +++ main/branches/prefix/pym/_emerge/__init__.py 2008-11-22 11:26:59 UTC (rev 12035)
103 @@ -4357,7 +4357,7 @@
104 self._show_merge_list()
105
106 msg = []
107 - msg.append("\n!!! Multiple versions within a single " + \
108 + msg.append("\n!!! Multiple package instances within a single " + \
109 "package slot have been pulled\n")
110 msg.append("!!! into the dependency graph, resulting" + \
111 " in a slot conflict:\n\n")
112 @@ -4616,6 +4616,23 @@
113 priority=priority)
114 return 1
115 else:
116 +
117 + if pkg.cpv == existing_node.cpv and \
118 + dep.atom is not None and \
119 + dep.atom.use:
120 + # Multiple different instances of the same version
121 + # (typically one installed and another not yet
122 + # installed) have been pulled into the graph due
123 + # to a USE dependency. The "slot collision" display
124 + # is not helpful in a case like this, so display it
125 + # as an unsatisfied dependency.
126 + self._unsatisfied_deps_for_display.append(
127 + ((dep.root, dep.atom), {"myparent":dep.parent}))
128 + self._slot_collision_info.add((pkg.slot_atom, pkg.root))
129 + self._slot_collision_nodes.add(pkg)
130 + self.digraph.addnode(pkg, myparent, priority=priority)
131 + return 0
132 +
133 if pkg in self._slot_collision_nodes:
134 return 1
135 # A slot collision has occurred. Sometimes this coincides
136 @@ -7613,8 +7630,35 @@
137 the merge list where it is most likely to be seen, but if display()
138 is not going to be called then this method should be called explicitly
139 to ensure that the user is notified of problems with the graph.
140 +
141 + All output goes to stderr, except for unsatisfied dependencies which
142 + go to stdout for parsing by programs such as autounmask.
143 """
144
145 + # Note that show_masked_packages() sends it's output to
146 + # stdout, and some programs such as autounmask parse the
147 + # output in cases when emerge bails out. However, when
148 + # show_masked_packages() is called for installed packages
149 + # here, the message is a warning that is more appropriate
150 + # to send to stderr, so temporarily redirect stdout to
151 + # stderr. TODO: Fix output code so there's a cleaner way
152 + # to redirect everything to stderr.
153 + sys.stdout.flush()
154 + sys.stderr.flush()
155 + stdout = sys.stdout
156 + try:
157 + sys.stdout = sys.stderr
158 + self._display_problems()
159 + finally:
160 + sys.stdout = stdout
161 + sys.stdout.flush()
162 + sys.stderr.flush()
163 +
164 + # This goes to stdout for parsing by programs like autounmask.
165 + for pargs, kwargs in self._unsatisfied_deps_for_display:
166 + self._show_unsatisfied_dep(*pargs, **kwargs)
167 +
168 + def _display_problems(self):
169 if self._circular_deps_for_display is not None:
170 self._show_circular_deps(
171 self._circular_deps_for_display)
172 @@ -7709,9 +7753,6 @@
173 show_mask_docs()
174 print
175
176 - for pargs, kwargs in self._unsatisfied_deps_for_display:
177 - self._show_unsatisfied_dep(*pargs, **kwargs)
178 -
179 def calc_changelog(self,ebuildpath,current,next):
180 if ebuildpath == None or not os.path.exists(ebuildpath):
181 return []
182 @@ -8561,7 +8602,7 @@
183
184 if max_load is not None and \
185 (max_jobs is True or max_jobs > 1) and \
186 - self._running_job_count() > 1:
187 + self._running_job_count() >= 1:
188 try:
189 avg1, avg5, avg15 = os.getloadavg()
190 except OSError, e:
191 @@ -12742,9 +12783,12 @@
192 for consumer_dblink in set(chain(*consumers.values())):
193 consumer_pkg = vardb.get(("installed", myroot,
194 consumer_dblink.mycpv, "nomerge"))
195 - resolver._add_pkg(pkg, Dependency(parent=consumer_pkg,
196 + if not resolver._add_pkg(pkg,
197 + Dependency(parent=consumer_pkg,
198 priority=UnmergeDepPriority(runtime=True),
199 - root=pkg.root))
200 + root=pkg.root)):
201 + resolver.display_problems()
202 + return 1
203
204 writemsg_level("\nCalculating dependencies ")
205 success = resolver._complete_graph()
206
207 Modified: main/branches/prefix/pym/portage/dbapi/bintree.py
208 ===================================================================
209 --- main/branches/prefix/pym/portage/dbapi/bintree.py 2008-11-22 09:19:48 UTC (rev 12034)
210 +++ main/branches/prefix/pym/portage/dbapi/bintree.py 2008-11-22 11:26:59 UTC (rev 12035)
211 @@ -980,7 +980,7 @@
212 def isremote(self, pkgname):
213 """Returns true if the package is kept remotely and it has not been
214 downloaded (or it is only partially downloaded)."""
215 - if pkgname not in self._remotepkgs:
216 + if self._remotepkgs is None or pkgname not in self._remotepkgs:
217 return False
218 pkg_path = self.getname(pkgname)
219 if os.path.exists(pkg_path) and \
220
221 Modified: main/branches/prefix/pym/portage/news.py
222 ===================================================================
223 --- main/branches/prefix/pym/portage/news.py 2008-11-22 09:19:48 UTC (rev 12034)
224 +++ main/branches/prefix/pym/portage/news.py 2008-11-22 11:26:59 UTC (rev 12035)
225 @@ -100,10 +100,13 @@
226 unread_filename = self._unread_filename(repoid)
227 unread_lock = lockfile(unread_filename, wantnewlockfile=1)
228 try:
229 - unread = set(grabfile(unread_filename))
230 - unread_orig = unread.copy()
231 - skip = set(grabfile(skip_filename))
232 - skip_orig = skip.copy()
233 + try:
234 + unread = set(grabfile(unread_filename))
235 + unread_orig = unread.copy()
236 + skip = set(grabfile(skip_filename))
237 + skip_orig = skip.copy()
238 + except PermissionDenied:
239 + return
240
241 updates = []
242 for itemid in news:
243 @@ -156,7 +159,10 @@
244 except (InvalidLocation, OperationNotPermitted, PermissionDenied):
245 return 0
246 try:
247 - return len(grabfile(unread_filename))
248 + try:
249 + return len(grabfile(unread_filename))
250 + except PermissionDenied:
251 + return 0
252 finally:
253 if unread_lock:
254 unlockfile(unread_lock)