summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-08 00:06:10 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-08 00:06:10 +0000
commit5caad3ae98a8e1c664ea2a55391f1f0b27d1bd57 (patch)
tree6d877d3d88653721d516f0da16dddcc54a6cb776
parentd557bea6d2c3bc311d03f5a4887092957586a16d (diff)
downloadportage-5caad3ae98a8e1c664ea2a55391f1f0b27d1bd57.tar.gz
portage-5caad3ae98a8e1c664ea2a55391f1f0b27d1bd57.tar.bz2
portage-5caad3ae98a8e1c664ea2a55391f1f0b27d1bd57.zip
Bug #287950 - Add a --fail-clean[=n] option, for enabling or disabling
FEATURES=fail-clean from the command line. svn path=/main/trunk/; revision=14518
-rw-r--r--man/emerge.17
-rw-r--r--pym/_emerge/actions.py13
-rw-r--r--pym/_emerge/help.py9
-rw-r--r--pym/_emerge/main.py10
4 files changed, 39 insertions, 0 deletions
diff --git a/man/emerge.1 b/man/emerge.1
index 602fda926..12be26e7c 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -330,6 +330,13 @@ specifications while differing from the installed set of packages as
little as possible. You should run with \fB\-\-pretend\fR first to make
sure the result is what you expect.
.TP
+.BR "\-\-fail\-clean[=n]"
+Clean up temporary files after a build failure. This is
+particularly useful if you have \fBPORTAGE_TMPDIR\fR on
+tmpfs. If this option is enabled, you probably also want
+to enable \fBPORT_LOGDIR\fR (see \fBmake.conf\fR(5)) in
+order to save the build log.
+.TP
.BR "\-\-fetchonly " (\fB\-f\fR)
Instead of doing any package building, just perform fetches for all
packages (fetch things from SRC_URI based upon USE setting).
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index eaaa69650..5fc43bd7b 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2330,6 +2330,19 @@ def adjust_config(myopts, settings):
settings['FEATURES'] = ' '.join(sorted(settings.features))
settings.backup_changes("FEATURES")
+ fail_clean = myopts.get('--fail-clean')
+ if fail_clean is not None:
+ if fail_clean is True and \
+ 'fail-clean' not in settings.features:
+ settings.features.add('fail-clean')
+ settings['FEATURES'] = ' '.join(sorted(settings.features))
+ settings.backup_changes('FEATURES')
+ elif fail_clean == 'n' and \
+ 'fail-clean' in settings.features:
+ settings.features.remove('fail-clean')
+ settings['FEATURES'] = ' '.join(sorted(settings.features))
+ settings.backup_changes('FEATURES')
+
CLEAN_DELAY = 5
try:
CLEAN_DELAY = int(settings.get("CLEAN_DELAY", str(CLEAN_DELAY)))
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index c0a6d01d5..312952295 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -346,6 +346,15 @@ def help(myopts, havecolor=1):
print(" it possible for developers to get a complete overview of the")
print(" complete dependency tree of a certain package.")
print()
+ print(" "+green("--fail-clean[=n]"))
+ desc = "Clean up temporary files after a build failure. This is " + \
+ "particularly useful if you have PORTAGE_TMPDIR on " + \
+ "tmpfs. If this option is enabled, you probably also want " + \
+ "to enable PORT_LOGDIR (see make.conf(5)) in " + \
+ "order to save the build log."
+ for line in wrap(desc, desc_width):
+ print(desc_indent + line)
+ print()
print(" "+green("--fetchonly")+" ("+green("-f")+" short option)")
print(" Instead of doing any package building, just perform fetches for")
print(" all packages (main package as well as all dependencies.) When")
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 8afa37ddd..2eedee341 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -382,6 +382,7 @@ def insert_optional_args(args):
'--deep' : valid_integers,
'--deselect' : ('n',),
'--binpkg-respect-use' : ('n', 'y',),
+ '--fail-clean' : ('n',),
'--getbinpkg' : ('n',),
'--getbinpkgonly' : ('n',),
'--jobs' : valid_integers,
@@ -537,6 +538,12 @@ def parse_opts(tmpcmdline, silent=False):
"choices" : ("True", "n")
},
+ "--fail-clean": {
+ "help" : "clean temp files after build failure",
+ "type" : "choice",
+ "choices" : ("True", "n")
+ },
+
"--jobs": {
"shortopt" : "-j",
@@ -671,6 +678,9 @@ def parse_opts(tmpcmdline, silent=False):
else:
myoptions.complete_graph = None
+ if myoptions.fail_clean == "True":
+ myoptions.fail_clean = True
+
if myoptions.getbinpkg in ("True",):
myoptions.getbinpkg = True
else: