diff --git a/build.py b/build.py index d1ad62c3..dfd9d7a0 100755 --- a/build.py +++ b/build.py @@ -118,7 +118,7 @@ def build_server(app, thisbuild, build_dir, output_dir): raise BuildException("Failed to destroy") -def build_local(app, thisbuild, build_dir, output_dir): +def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir, install): """Do a build locally.""" # Prepare the source code... @@ -156,8 +156,6 @@ def build_local(app, thisbuild, build_dir, output_dir): if p.returncode != 0: print output raise BuildException("NDK build failed for %s:%s" % (app['id'], thisbuild['version'])) - elif options.verbose: - print output # Build the release... if thisbuild.has_key('maven'): @@ -165,7 +163,7 @@ def build_local(app, thisbuild, build_dir, output_dir): '-Dandroid.sdk.path=' + sdk_path], cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) else: - if options.install: + if install: antcommands = ['debug',' install'] elif thisbuild.has_key('antcommand'): antcommands = [thisbuild['antcommand']] @@ -176,8 +174,6 @@ def build_local(app, thisbuild, build_dir, output_dir): output, error = p.communicate() if p.returncode != 0: raise BuildException("Build failed for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip()) - elif options.verbose: - print output print "Build successful" # Find the apk name in the output... @@ -241,6 +237,8 @@ def build_local(app, thisbuild, build_dir, output_dir): # Copy the unsigned apk to our destination directory for further # processing (by publish.py)... + dest = os.path.join(output_dir, app['id'] + '_' + + thisbuild['vercode'] + '.apk') shutil.copyfile(src, dest) # Move the source tarball into the output directory... @@ -250,7 +248,8 @@ def build_local(app, thisbuild, build_dir, output_dir): os.path.join(output_dir, tarfilename)) -def trybuild(app, thisbuild, build_dir, output_dir, repo_dir, vcs, test): +def trybuild(app, thisbuild, build_dir, output_dir, extlib_dir, tmp_dir, + repo_dir, vcs, test, server, install): """ Build a particular version of an application, if it needs building. @@ -268,16 +267,12 @@ def trybuild(app, thisbuild, build_dir, output_dir, repo_dir, vcs, test): if thisbuild['commit'].startswith('!'): return False - if options.verbose: - mstart = '.. building version ' - else: - mstart = 'Building version ' - print mstart + thisbuild['version'] + ' of ' + app['id'] + print "Building version " + thisbuild['version'] + ' of ' + app['id'] - if options.server: + if server: build_server(app, thisbuild, build_dir, output_dir) else: - build_local(app, thisbuild, build_dir, output_dir) + build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir, install) return True @@ -313,6 +308,9 @@ def parse_commandline(): # The --install option implies --test and --force... if options.install: + if options.server: + print "Can't install when building on a build server." + sys.exit(1) options.force = True options.test = True @@ -322,7 +320,7 @@ def parse_commandline(): def main(): # Read configuration... - execfile('config.py') + execfile('config.py', globals()) options, args = parse_commandline() # Get all apps... @@ -382,8 +380,9 @@ def main(): for thisbuild in app['builds']: try: - if trybuild(app, thisbuild, build_dir, output_dir, repo_dir, - vcs, options.test): + if trybuild(app, thisbuild, build_dir, output_dir, extlib_dir, + tmp_dir, repo_dir, vcs, options.test, options.server, + options.install): build_succeeded.append(app) except BuildException as be: if options.stop: diff --git a/checkupdates.py b/checkupdates.py index b679d6f8..bd0fffbf 100755 --- a/checkupdates.py +++ b/checkupdates.py @@ -46,6 +46,7 @@ def check_market(app): m = re.search('
([^>]+)
', page) if m: + html_parser = HTMLParser.HTMLParser() version = html_parser.unescape(m.group(1)) if version == 'Varies with device': @@ -66,7 +67,7 @@ def check_market(app): def main(): #Read configuration... - execfile('config.py') + execfile('config.py', globals()) # Parse command line... parser = OptionParser() @@ -79,8 +80,6 @@ def main(): # Get all apps... apps = common.read_metadata(options.verbose) - html_parser = HTMLParser.HTMLParser() - for app in apps: if options.package and options.package != app['id']: diff --git a/import.py b/import.py index 3d794cb8..0e7307c9 100755 --- a/import.py +++ b/import.py @@ -28,11 +28,7 @@ from optparse import OptionParser def main(): # Read configuration... - repo_name = None - repo_description = None - repo_icon = None - repo_url = None - execfile('config.py') + execfile('config.py', globals()) import common diff --git a/publish.py b/publish.py index c5610ffe..be92c3ed 100755 --- a/publish.py +++ b/publish.py @@ -34,7 +34,7 @@ from common import BuildException def main(): #Read configuration... - execfile('config.py') + execfile('config.py', globals()) # Parse command line... parser = OptionParser() diff --git a/scanner.py b/scanner.py index ad4e20fb..382b1982 100755 --- a/scanner.py +++ b/scanner.py @@ -34,7 +34,7 @@ from common import VCSException def main(): # Read configuration... - execfile('config.py') + execfile('config.py', globals()) # Parse command line... diff --git a/stats.py b/stats.py index a6f98169..5492096e 100755 --- a/stats.py +++ b/stats.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# updatestats.py - part of the FDroid server tools +# stats.py - part of the FDroid server tools # Copyright (C) 2010-12, Ciaran Gultnieks, ciaran@ciarang.com # # This program is free software: you can redistribute it and/or modify @@ -33,7 +33,7 @@ import common def main(): # Read configuration... - execfile('config.py') + execfile('config.py', globals()) # Parse command line... parser = OptionParser() diff --git a/update.py b/update.py index f378db7c..b03258ba 100755 --- a/update.py +++ b/update.py @@ -32,11 +32,7 @@ import time def main(): # Read configuration... - repo_name = None - repo_description = None - repo_icon = None - repo_url = None - execfile('config.py') + execfile('config.py', globals()) import common @@ -69,13 +65,6 @@ def main(): warnings = 0 - # Make sure we have the repository description... - if (repo_url is None or repo_name is None or - repo_icon is None or repo_description is None): - print "Repository description fields are required in config.py" - print "See config.sample.py for details" - sys.exit(1) - # Get all apps... apps = common.read_metadata(verbose=options.verbose)