From 5caad3ae98a8e1c664ea2a55391f1f0b27d1bd57 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 8 Oct 2009 00:06:10 +0000 Subject: 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 --- pym/_emerge/actions.py | 13 +++++++++++++ pym/_emerge/help.py | 9 +++++++++ pym/_emerge/main.py | 10 ++++++++++ 3 files changed, 32 insertions(+) (limited to 'pym/_emerge') 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: -- cgit v1.2.3-1-g7c22