Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13876 - in main/branches/prefix: man pym/_emerge pym/portage
Date: Sun, 02 Aug 2009 14:32:07
Message-Id: E1MXc6X-0000bQ-2l@stork.gentoo.org
1 Author: grobian
2 Date: 2009-08-02 14:32:04 +0000 (Sun, 02 Aug 2009)
3 New Revision: 13876
4
5 Modified:
6 main/branches/prefix/man/emerge.1
7 main/branches/prefix/pym/_emerge/help.py
8 main/branches/prefix/pym/_emerge/main.py
9 main/branches/prefix/pym/portage/__init__.py
10 Log:
11 Merged from trunk -r13865:13874
12
13 |13870 |In the _check_build_log(), exclude output from dev-libs/yaz-3.0.47 |
14 |zmedico|which looks like this: Configuration: Automake: ${SHELL} |
15 | |/var/tmp/portage/dev-libs/yaz-3.0.47/work/yaz-3.0.47/config/missing |
16 | |--run automake-1.10 Thanks to Robin H. Johnson <robbat2@g.o> for|
17 | |reporting. |
18
19 |13872 |Add support for --complete-graph=n so that it's possible to disable it |
20 |zmedico|on the command line after it's been enabled in EMERGE_DEFAULT_OPTS. |
21
22 |13873 |Add support for --usepkg=n so that it's possible to disable it on the |
23 |zmedico|command line after it's been enabled in EMERGE_DEFAULT_OPTS. Also do |
24 | |the same for --usepkgonly, --getbinpkg, and --getbinpkgonly. |
25
26 |13874 |Only treat non-negative integers as valid in insert_optional_args(). |
27 |zmedico| |
28
29
30 Modified: main/branches/prefix/man/emerge.1
31 ===================================================================
32 --- main/branches/prefix/man/emerge.1 2009-08-02 14:27:30 UTC (rev 13875)
33 +++ main/branches/prefix/man/emerge.1 2009-08-02 14:32:04 UTC (rev 13876)
34 @@ -281,7 +281,7 @@
35 Used alongside \fB\-\-pretend\fR to cause the package name, new version,
36 and old version to be displayed in an aligned format for easy cut\-n\-paste.
37 .TP
38 -.BR "\-\-complete\-graph"
39 +.BR "\-\-complete\-graph[=n]"
40 This causes \fBemerge\fR to consider the deep dependencies of all
41 packages from the system and world sets. With this option enabled,
42 \fBemerge\fR will bail out if it determines that the given operation will
43 @@ -324,14 +324,14 @@
44 Instead of doing any package building, just perform fetches for all
45 packages (fetch everything in SRC_URI regardless of USE setting).
46 .TP
47 -.BR "\-\-getbinpkg " (\fB\-g\fR)
48 +.BR "\-\-getbinpkg[=n] " (\fB\-g\fR)
49 Using the server and location defined in \fIPORTAGE_BINHOST\fR (see
50 \fBmake.conf\fR(5)), portage will download the information from each binary
51 package found and it will use that information to help build the dependency
52 list. This option implies \fB\-k\fR. (Use \fB\-gK\fR for binary\-only
53 merging.)
54 .TP
55 -.BR "\-\-getbinpkgonly " (\fB\-G\fR)
56 +.BR "\-\-getbinpkgonly[=n] " (\fB\-G\fR)
57 This option is identical to \fB\-g\fR, as above, except binaries from the
58 remote server are preferred over local packages if they are not identical.
59 .TP
60 @@ -462,13 +462,13 @@
61 This is only really useful in combination with \fB\-\-emptytree\fR or
62 \fB\-\-update\fR and \fB\-\-deep\fR.
63 .TP
64 -.BR "\-\-usepkg " (\fB\-k\fR)
65 +.BR "\-\-usepkg[=n] " (\fB\-k\fR)
66 Tells emerge to use binary packages (from $PKGDIR) if they are available, thus
67 possibly avoiding some time\-consuming compiles. This option is useful for CD
68 installs; you can export PKGDIR=/mnt/cdrom/packages and then use this option to
69 have emerge "pull" binary packages from the CD in order to satisfy dependencies.
70 .TP
71 -.BR "\-\-usepkgonly " (\fB\-K\fR)
72 +.BR "\-\-usepkgonly[=n] " (\fB\-K\fR)
73 Tells emerge to only use binary packages (from $PKGDIR). All the binary
74 packages must be available at the time of dependency calculation or emerge
75 will simply abort. Portage does not use $PORTDIR when calculating dependency
76
77 Modified: main/branches/prefix/pym/_emerge/help.py
78 ===================================================================
79 --- main/branches/prefix/pym/_emerge/help.py 2009-08-02 14:27:30 UTC (rev 13875)
80 +++ main/branches/prefix/pym/_emerge/help.py 2009-08-02 14:32:04 UTC (rev 13876)
81 @@ -287,7 +287,7 @@
82 print " Display the pretend output in a tabular form. Versions are"
83 print " aligned vertically."
84 print
85 - print " "+green("--complete-graph")
86 + print " "+green("--complete-graph") + "[=%s]" % turquoise("n")
87 desc = "This causes emerge to consider the deep dependencies of all" + \
88 " packages from the system and world sets. With this option enabled," + \
89 " emerge will bail out if it determines that the given operation will" + \
90 @@ -338,13 +338,13 @@
91 print " Same as --fetchonly except that all package files, including those"
92 print " not required to build the package, will be processed."
93 print
94 - print " "+green("--getbinpkg")+" ("+green("-g")+" short option)"
95 + print " "+green("--getbinpkg")+ "[=%s]" % turquoise("n") + " ("+green("-g")+" short option)"
96 print " Using the server and location defined in PORTAGE_BINHOST, portage"
97 print " will download the information from each binary file there and it"
98 print " will use that information to help build the dependency list. This"
99 print " option implies '-k'. (Use -gK for binary-only merging.)"
100 print
101 - print " "+green("--getbinpkgonly")+" ("+green("-G")+" short option)"
102 + print " "+green("--getbinpkgonly")+ "[=%s]" % turquoise("n") + " ("+green("-G")+" short option)"
103 print " This option is identical to -g, as above, except it will not use"
104 print " ANY information from the local machine. All binaries will be"
105 print " downloaded from the remote server without consulting packages"
106 @@ -492,7 +492,7 @@
107 print " a package's dependencies follow the package. Only really useful"
108 print " in combination with --emptytree, --update or --deep."
109 print
110 - print " "+green("--usepkg")+" ("+green("-k")+" short option)"
111 + print " "+green("--usepkg")+ "[=%s]" % turquoise("n") + " ("+green("-k")+" short option)"
112 print " Tell emerge to use binary packages (from $PKGDIR) if they are"
113 print " available, thus possibly avoiding some time-consuming compiles."
114 print " This option is useful for CD installs; you can export"
115 @@ -500,7 +500,7 @@
116 print " emerge \"pull\" binary packages from the CD in order to satisfy"
117 print " dependencies."
118 print
119 - print " "+green("--usepkgonly")+" ("+green("-K")+" short option)"
120 + print " "+green("--usepkgonly")+ "[=%s]" % turquoise("n") + " ("+green("-K")+" short option)"
121 print " Like --usepkg above, except this only allows the use of binary"
122 print " packages, and it will abort the emerge if the package is not"
123 print " available at the time of dependency calculation."
124
125 Modified: main/branches/prefix/pym/_emerge/main.py
126 ===================================================================
127 --- main/branches/prefix/pym/_emerge/main.py 2009-08-02 14:27:30 UTC (rev 13875)
128 +++ main/branches/prefix/pym/_emerge/main.py 2009-08-02 14:32:04 UTC (rev 13876)
129 @@ -61,12 +61,10 @@
130 "--ask", "--alphabetical",
131 "--buildpkg", "--buildpkgonly",
132 "--changelog", "--columns",
133 -"--complete-graph",
134 "--debug",
135 "--digest",
136 "--emptytree",
137 "--fetchonly", "--fetch-all-uri",
138 -"--getbinpkg", "--getbinpkgonly",
139 "--ignore-default-opts",
140 "--keep-going",
141 "--noconfmem",
142 @@ -79,7 +77,6 @@
143 "--skipfirst",
144 "--tree",
145 "--update",
146 -"--usepkg", "--usepkgonly",
147 "--verbose",
148 ]
149
150 @@ -91,9 +88,7 @@
151 "d":"--debug",
152 "e":"--emptytree",
153 "f":"--fetchonly", "F":"--fetch-all-uri",
154 -"g":"--getbinpkg", "G":"--getbinpkgonly",
155 "h":"--help",
156 -"k":"--usepkg", "K":"--usepkgonly",
157 "l":"--changelog",
158 "n":"--noreplace", "N":"--newuse",
159 "o":"--onlydeps", "O":"--nodeps",
160 @@ -386,21 +381,25 @@
161 class valid_integers(object):
162 def __contains__(self, s):
163 try:
164 - int(s)
165 + return int(s) >= 0
166 except (ValueError, OverflowError):
167 return False
168 - return True
169
170 valid_integers = valid_integers()
171
172 new_args = []
173
174 default_arg_opts = {
175 + '--complete-graph' : ('n',),
176 '--deep' : valid_integers,
177 '--deselect' : ('n',),
178 '--binpkg-respect-use' : ('n', 'y',),
179 + '--getbinpkg' : ('n',),
180 + '--getbinpkgonly' : ('n',),
181 '--jobs' : valid_integers,
182 '--root-deps' : ('rdeps',),
183 + '--usepkg' : ('n',),
184 + '--usepkgonly' : ('n',),
185 }
186
187 short_arg_opts = {
188 @@ -408,6 +407,15 @@
189 'j' : valid_integers,
190 }
191
192 + # Don't make things like "-kn" expand to "-k n"
193 + # since existence of -n makes it too ambiguous.
194 + short_arg_opts_n = {
195 + 'g' : ('n',),
196 + 'G' : ('n',),
197 + 'k' : ('n',),
198 + 'K' : ('n',),
199 + }
200 +
201 arg_stack = args[:]
202 arg_stack.reverse()
203 while arg_stack:
204 @@ -434,6 +442,12 @@
205 break
206
207 if match is None:
208 + for k, arg_choices in short_arg_opts_n.iteritems():
209 + if k in arg:
210 + match = k
211 + break
212 +
213 + if match is None:
214 new_args.append(arg)
215 continue
216
217 @@ -454,7 +468,7 @@
218 saved_opts = None
219
220 if arg[1:2] == match:
221 - if arg[2:] in arg_choices:
222 + if match not in short_arg_opts_n and arg[2:] in arg_choices:
223 opt_arg = arg[2:]
224 else:
225 saved_opts = arg[2:]
226 @@ -503,6 +517,12 @@
227 "choices":("y", "n")
228 },
229
230 + "--complete-graph": {
231 + "help" : "completely account for all known dependencies",
232 + "type" : "choice",
233 + "choices" : ("True", "n")
234 + },
235 +
236 "--deep": {
237
238 "shortopt" : "-D",
239 @@ -558,6 +578,20 @@
240 "choices" : ("True", "y", "n")
241 },
242
243 + "--getbinpkg": {
244 + "shortopt" : "-g",
245 + "help" : "fetch binary packages",
246 + "type" : "choice",
247 + "choices" : ("True", "n")
248 + },
249 +
250 + "--getbinpkgonly": {
251 + "shortopt" : "-G",
252 + "help" : "fetch binary packages only",
253 + "type" : "choice",
254 + "choices" : ("True", "n")
255 + },
256 +
257 "--root": {
258 "help" : "specify the target root filesystem for merging packages",
259 "action" : "store"
260 @@ -568,6 +602,21 @@
261 "type" : "choice",
262 "choices" :("True", "rdeps")
263 },
264 +
265 + "--usepkg": {
266 + "shortopt" : "-k",
267 + "help" : "use binary packages",
268 + "type" : "choice",
269 + "choices" : ("True", "n")
270 + },
271 +
272 + "--usepkgonly": {
273 + "shortopt" : "-K",
274 + "help" : "use only binary packages",
275 + "type" : "choice",
276 + "choices" : ("True", "n")
277 + },
278 +
279 }
280
281 from optparse import OptionParser
282 @@ -608,6 +657,21 @@
283 else:
284 myoptions.binpkg_respect_use = None
285
286 + if myoptions.complete_graph in ("y", "True",):
287 + myoptions.complete_graph = True
288 + else:
289 + myoptions.complete_graph = None
290 +
291 + if myoptions.getbinpkg in ("True",):
292 + myoptions.getbinpkg = True
293 + else:
294 + myoptions.getbinpkg = None
295 +
296 + if myoptions.getbinpkgonly in ("True",):
297 + myoptions.getbinpkgonly = True
298 + else:
299 + myoptions.getbinpkgonly = None
300 +
301 if myoptions.root_deps == "True":
302 myoptions.root_deps = True
303
304 @@ -662,6 +726,16 @@
305
306 myoptions.load_average = load_average
307
308 + if myoptions.usepkg in ("True",):
309 + myoptions.usepkg = True
310 + else:
311 + myoptions.usepkg = None
312 +
313 + if myoptions.usepkgonly in ("True",):
314 + myoptions.usepkgonly = True
315 + else:
316 + myoptions.usepkgonly = None
317 +
318 for myopt in options:
319 v = getattr(myoptions, myopt.lstrip("--").replace("-", "_"))
320 if v:
321
322 Modified: main/branches/prefix/pym/portage/__init__.py
323 ===================================================================
324 --- main/branches/prefix/pym/portage/__init__.py 2009-08-02 14:27:30 UTC (rev 13875)
325 +++ main/branches/prefix/pym/portage/__init__.py 2009-08-02 14:32:04 UTC (rev 13876)
326 @@ -5050,9 +5050,14 @@
327 configure_opts_warn = []
328 configure_opts_warn_re = re.compile(
329 r'^configure: WARNING: [Uu]nrecognized options: ')
330 +
331 + # Exclude output from dev-libs/yaz-3.0.47 which looks like this:
332 + #
333 + #Configuration:
334 + # Automake: ${SHELL} /var/tmp/portage/dev-libs/yaz-3.0.47/work/yaz-3.0.47/config/missing --run automake-1.10
335 am_maintainer_mode_re = re.compile(r'/missing --run ')
336 am_maintainer_mode_exclude_re = \
337 - re.compile(r'/missing --run (autoheader|makeinfo)')
338 + re.compile(r'(/missing --run (autoheader|makeinfo)|^\s*Automake:\s)')
339
340 make_jobserver_re = \
341 re.compile(r'g?make\[\d+\]: warning: jobserver unavailable:')