chiark / gitweb /
Add another build option to skip source scanning
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 16 Feb 2014 16:40:54 +0000 (17:40 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 16 Feb 2014 16:40:54 +0000 (17:40 +0100)
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.

completion/bash-completion
fdroidserver/build.py

index 08accbe8ba0394c0a1d1385567635bee5311247b..0d277a2d54471c7518f031c93a75855d219d3388 100644 (file)
@@ -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
index c83fb0ceb45169e90326e11a607f427417a3790b..7ed210dc8925a68979dea2f6fd8ecb197db59f0a 100644 (file)
@@ -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,