summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorPaul Varner <fuzzyray@gentoo.org>2015-10-19 16:11:56 -0500
committerPaul Varner <fuzzyray@gentoo.org>2015-10-19 16:11:56 -0500
commit2bf6fcfa9060f2490d77e4c5ea3dcd596e6b4c6b (patch)
treeabd66e643c22dce7df03c42096666810fea0587d /pym
parentf584990c08fc5a400277acfeaf01297f1d3b995b (diff)
downloadgentoolkit-2bf6fcfa9060f2490d77e4c5ea3dcd596e6b4c6b.tar.gz
eclean: Add option to allow for missing PKGDIR. Bug 551266
Added -i, --ignore-failure to ignore a missing PKGDIR error and exit cleanly. This was requested by the Chromium OS project, since they run eclean in an automated process and the directory may not exist yet. References: http://crbug.com/323420
Diffstat (limited to 'pym')
-rw-r--r--pym/gentoolkit/eclean/cli.py9
-rw-r--r--pym/gentoolkit/eclean/search.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py
index 95d4c06..1c8e66f 100644
--- a/pym/gentoolkit/eclean/cli.py
+++ b/pym/gentoolkit/eclean/cli.py
@@ -147,7 +147,8 @@ def printUsage(_error=None, help=None):
or help in ('all','packages'):
print( "Available", yellow("options"),"for the",
green("packages"),"action:", file=out)
- print( yellow(" NONE :)"), file=out)
+ print( yellow(" -i, --ignore-failure")+
+ " - ignore failure to locate PKGDIR", file=out)
print( file=out)
if _error in ('distfiles-options', 'merged-distfiles-options') \
or help in ('all','distfiles'):
@@ -262,6 +263,8 @@ def parseArgs(options={}):
options['size-limit'] = parseSize(a)
elif o in ("-v", "--verbose") and not options['quiet']:
options['verbose'] = True
+ elif o in ("-i", "--ignore-failure"):
+ options['ignore-failure'] = True
else:
return_code = False
# sanity check of --deep only options:
@@ -286,8 +289,8 @@ def parseArgs(options={}):
"time-limit=", "package-names", "help", "version", "verbose"]
getopt_options['short']['distfiles'] = "fs:"
getopt_options['long']['distfiles'] = ["fetch-restricted", "size-limit="]
- getopt_options['short']['packages'] = ""
- getopt_options['long']['packages'] = [""]
+ getopt_options['short']['packages'] = "i"
+ getopt_options['long']['packages'] = ["ignore-failure"]
# set default options, except 'nocolor', which is set in main()
options['interactive'] = False
options['pretend'] = False
diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index 1a83fd4..f771ffc 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -532,6 +532,8 @@ def findPackages(
test = os.listdir(pkgdir)
del test
except EnvironmentError as er:
+ if options['ignore-failure']:
+ exit(0)
print( pp.error("Error accessing PKGDIR." ), file=sys.stderr)
print( pp.error("(Check your make.conf file and environment)."), file=sys.stderr)
print( pp.error("Error: %s" %str(er)), file=sys.stderr)