From: Daniel Martí Date: Sun, 16 Feb 2014 16:40:54 +0000 (+0100) Subject: Add another build option to skip source scanning X-Git-Tag: 0.2~275 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=898e4485c2ab696c284917d3fc8fafaa29445197;p=fdroidserver.git Add another build option to skip source scanning It can be very slow on large source code dirs, and if one is trying to get an application building and the scan already succeeded once, running it again and again is a waste of time. --- diff --git a/completion/bash-completion b/completion/bash-completion index 08accbe8..0d277a2d 100644 --- a/completion/bash-completion +++ b/completion/bash-completion @@ -94,7 +94,7 @@ __complete_options() { __complete_build() { opts="-h -v -c -l -s -t -f" lopts="--help --verbose --latest --server --resetserver --on-server - --force --all" + --skip-scan --no-tarball --force --all" case "${cur}" in -*) __complete_options diff --git a/fdroidserver/build.py b/fdroidserver/build.py index c83fb0ce..7ed210dc 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -419,16 +419,17 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d raise BuildException("Error cleaning %s:%s" % (app['id'], thisbuild['version']), p.stdout) - # Scan before building... - logging.info("Scanning source for common problems...") - buildprobs = common.scan_source(build_dir, root_dir, thisbuild) - if len(buildprobs) > 0: - logging.info('Scanner found %d problems:' % len(buildprobs)) - for problem in buildprobs: - logging.info(' %s' % problem) - if not force: - raise BuildException("Can't build due to " + - str(len(buildprobs)) + " scanned problems") + if not options.skipscan: + # Scan before building... + logging.info("Scanning source for common problems...") + buildprobs = common.scan_source(build_dir, root_dir, thisbuild) + if len(buildprobs) > 0: + logging.info('Scanner found %d problems:' % len(buildprobs)) + for problem in buildprobs: + logging.info(' %s' % problem) + if not force: + raise BuildException("Can't build due to " + + str(len(buildprobs)) + " scanned problems") if not options.notarball: # Build the source tarball right before we build the release... @@ -777,6 +778,8 @@ def parse_commandline(): help="Reset and create a brand new build server, even if the existing one appears to be ok.") parser.add_option("--on-server", dest="onserver", action="store_true", default=False, help="Specify that we're running on the build server") + parser.add_option("--skip-scan", dest="skipscan", action="store_true", default=False, + help="Skip scanning the source code for binaries and other problems") parser.add_option("--no-tarball", dest="notarball", action="store_true", default=False, help="Don't create a source tarball, useful when testing a build") parser.add_option("-f", "--force", action="store_true", default=False,