From c4a5ced10ae5c86bc91c620f392badf1721343dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 20 Nov 2013 19:00:22 +0100 Subject: [PATCH] Fixes to srclibs with paths --- fdroidserver/build.py | 14 ++------------ fdroidserver/common.py | 20 +++++++------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 54997fbf..b34309e0 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -285,18 +285,8 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, force): srclibpaths = [] if 'srclibs' in thisbuild: for lib in thisbuild['srclibs'].split(';'): - number = None - subdir = None - lib = lib.strip() - name, ref = lib.split('@') - if ':' in name: - number, name = name.split(':', 1) - if '/' in name: - name, subdir = name.split('/',1) - if options.verbose: - print "Processing srclib '" + name + "'" - libpath = common.getsrclib(name+'@'+ref, 'build/srclib', srclibpaths, subdir, basepath=True, prepare=False) - srclibpaths.append((name, number, libpath)) + srclibpaths.append(common.getsrclib(lib, 'build/srclib', srclibpaths, + basepath=True, prepare=False)) # If one was used for the main source, add that too. basesrclib = vcs.getsrclib() diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 8a3298d5..9cd375da 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -719,8 +719,9 @@ def getsrclib(spec, srclib_dir, srclibpaths=[], subdir=None, basepath=False, remove_signing_keys(libdir) if basepath: - return sdir - return libdir + libdir = sdir + + return (name, number, libdir) # Prepare the source code for a particular build @@ -985,17 +986,10 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= if 'srclibs' in build: print "Collecting source libraries..." for lib in build['srclibs'].split(';'): - number = None - subdir = None - lib = lib.strip() - name, ref = lib.split('@') - if ':' in name: - number, name = name.split(':', 1) - if '/' in name: - name, subdir = name.split('/',1) - libpath = getsrclib(name+'@'+ref, srclib_dir, srclibpaths, subdir, preponly=onserver) - srclibpaths.append((name, number, libpath)) - place_srclib(root_dir, int(number) if number else None, libpath) + srclibpaths.append(getsrclib(lib, srclib_dir, srclibpaths, preponly=onserver)) + + for name, number, libpath in srclibpaths: + place_srclib(root_dir, int(number) if number else None, libpath) basesrclib = vcs.getsrclib() # If one was used for the main source, add that too.