Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r14518 - in main/trunk: man pym/_emerge
Date: Thu, 08 Oct 2009 00:06:13
Message-Id: E1MvgWJ-0000gq-Bz@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-10-08 00:06:10 +0000 (Thu, 08 Oct 2009)
3 New Revision: 14518
4
5 Modified:
6 main/trunk/man/emerge.1
7 main/trunk/pym/_emerge/actions.py
8 main/trunk/pym/_emerge/help.py
9 main/trunk/pym/_emerge/main.py
10 Log:
11 Bug #287950 - Add a --fail-clean[=n] option, for enabling or disabling
12 FEATURES=fail-clean from the command line.
13
14
15 Modified: main/trunk/man/emerge.1
16 ===================================================================
17 --- main/trunk/man/emerge.1 2009-10-07 23:30:04 UTC (rev 14517)
18 +++ main/trunk/man/emerge.1 2009-10-08 00:06:10 UTC (rev 14518)
19 @@ -330,6 +330,13 @@
20 little as possible. You should run with \fB\-\-pretend\fR first to make
21 sure the result is what you expect.
22 .TP
23 +.BR "\-\-fail\-clean[=n]"
24 +Clean up temporary files after a build failure. This is
25 +particularly useful if you have \fBPORTAGE_TMPDIR\fR on
26 +tmpfs. If this option is enabled, you probably also want
27 +to enable \fBPORT_LOGDIR\fR (see \fBmake.conf\fR(5)) in
28 +order to save the build log.
29 +.TP
30 .BR "\-\-fetchonly " (\fB\-f\fR)
31 Instead of doing any package building, just perform fetches for all
32 packages (fetch things from SRC_URI based upon USE setting).
33
34 Modified: main/trunk/pym/_emerge/actions.py
35 ===================================================================
36 --- main/trunk/pym/_emerge/actions.py 2009-10-07 23:30:04 UTC (rev 14517)
37 +++ main/trunk/pym/_emerge/actions.py 2009-10-08 00:06:10 UTC (rev 14518)
38 @@ -2330,6 +2330,19 @@
39 settings['FEATURES'] = ' '.join(sorted(settings.features))
40 settings.backup_changes("FEATURES")
41
42 + fail_clean = myopts.get('--fail-clean')
43 + if fail_clean is not None:
44 + if fail_clean is True and \
45 + 'fail-clean' not in settings.features:
46 + settings.features.add('fail-clean')
47 + settings['FEATURES'] = ' '.join(sorted(settings.features))
48 + settings.backup_changes('FEATURES')
49 + elif fail_clean == 'n' and \
50 + 'fail-clean' in settings.features:
51 + settings.features.remove('fail-clean')
52 + settings['FEATURES'] = ' '.join(sorted(settings.features))
53 + settings.backup_changes('FEATURES')
54 +
55 CLEAN_DELAY = 5
56 try:
57 CLEAN_DELAY = int(settings.get("CLEAN_DELAY", str(CLEAN_DELAY)))
58
59 Modified: main/trunk/pym/_emerge/help.py
60 ===================================================================
61 --- main/trunk/pym/_emerge/help.py 2009-10-07 23:30:04 UTC (rev 14517)
62 +++ main/trunk/pym/_emerge/help.py 2009-10-08 00:06:10 UTC (rev 14518)
63 @@ -346,6 +346,15 @@
64 print(" it possible for developers to get a complete overview of the")
65 print(" complete dependency tree of a certain package.")
66 print()
67 + print(" "+green("--fail-clean[=n]"))
68 + desc = "Clean up temporary files after a build failure. This is " + \
69 + "particularly useful if you have PORTAGE_TMPDIR on " + \
70 + "tmpfs. If this option is enabled, you probably also want " + \
71 + "to enable PORT_LOGDIR (see make.conf(5)) in " + \
72 + "order to save the build log."
73 + for line in wrap(desc, desc_width):
74 + print(desc_indent + line)
75 + print()
76 print(" "+green("--fetchonly")+" ("+green("-f")+" short option)")
77 print(" Instead of doing any package building, just perform fetches for")
78 print(" all packages (main package as well as all dependencies.) When")
79
80 Modified: main/trunk/pym/_emerge/main.py
81 ===================================================================
82 --- main/trunk/pym/_emerge/main.py 2009-10-07 23:30:04 UTC (rev 14517)
83 +++ main/trunk/pym/_emerge/main.py 2009-10-08 00:06:10 UTC (rev 14518)
84 @@ -382,6 +382,7 @@
85 '--deep' : valid_integers,
86 '--deselect' : ('n',),
87 '--binpkg-respect-use' : ('n', 'y',),
88 + '--fail-clean' : ('n',),
89 '--getbinpkg' : ('n',),
90 '--getbinpkgonly' : ('n',),
91 '--jobs' : valid_integers,
92 @@ -537,6 +538,12 @@
93 "choices" : ("True", "n")
94 },
95
96 + "--fail-clean": {
97 + "help" : "clean temp files after build failure",
98 + "type" : "choice",
99 + "choices" : ("True", "n")
100 + },
101 +
102 "--jobs": {
103
104 "shortopt" : "-j",
105 @@ -671,6 +678,9 @@
106 else:
107 myoptions.complete_graph = None
108
109 + if myoptions.fail_clean == "True":
110 + myoptions.fail_clean = True
111 +
112 if myoptions.getbinpkg in ("True",):
113 myoptions.getbinpkg = True
114 else: