From a68778c5a13406d4c6652b7d41ada1b42f5d1e12 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Fri, 28 Sep 2012 18:22:26 +0100 Subject: [PATCH] Don't try and xref-check descriptions on the build server --- fdroidserver/build.py | 4 ++-- fdroidserver/common.py | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 401490e1..70a27ee1 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -467,7 +467,7 @@ def parse_commandline(): help="Use build server") parser.add_option("--resetserver", action="store_true", default=False, help="Reset and create a brand new build server, even if the existing one appears to be ok.") - parser.add_option("--on-server", action="store_true", default=False, + 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("-f", "--force", action="store_true", default=False, help="Force build of disabled apps, and carries on regardless of scan problems. Only allowed in test mode.") @@ -517,7 +517,7 @@ def main(): sys.exit(1) # Get all apps... - apps = common.read_metadata(options.verbose) + apps = common.read_metadata(options.verbose, xref=not options.onserver) log_dir = 'logs' if not os.path.isdir(log_dir): diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 964f0cf1..0e27ad49 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -607,26 +607,27 @@ def write_metadata(dest, app): # Read all metadata. Returns a list of 'app' objects (which are dictionaries as # returned by the parse_metadata function. -def read_metadata(verbose=False): +def read_metadata(verbose=False, xref=True): apps = [] for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))): if verbose: print "Reading " + metafile apps.append(parse_metadata(metafile, verbose=verbose)) - # Parse all descriptions at load time, just to ensure cross-referencing - # errors are caught early rather than when they hit the build server. - def linkres(link): + if xref: + # Parse all descriptions at load time, just to ensure cross-referencing + # errors are caught early rather than when they hit the build server. + def linkres(link): + for app in apps: + if app['id'] == link: + return ("fdroid.app:" + link, "Dummy name - don't know yet") + raise MetaDataException("Cannot resolve app id " + link) for app in apps: - if app['id'] == link: - return ("fdroid.app:" + link, "Dummy name - don't know yet") - raise MetaDataException("Cannot resolve app id " + link) - for app in apps: - try: - description_html(app['Description'], linkres) - except Exception, e: - raise MetaDataException("Problem with description of " + app['id'] + - " - " + str(e)) + try: + description_html(app['Description'], linkres) + except Exception, e: + raise MetaDataException("Problem with description of " + app['id'] + + " - " + str(e)) return apps