From: Daniel Martí Date: Sun, 9 Jun 2013 21:15:46 +0000 (+0200) Subject: Substitute variables in Prepare for srclibs too X-Git-Tag: 0.1~543 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9c3b4a9daabb660b76586c27242f1b73744925c6;p=fdroidserver.git Substitute variables in Prepare for srclibs too --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 2579365e..80730fd8 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -989,7 +989,7 @@ def parse_srclib(metafile, **kw): # Returns the path to it. Normally this is the path to be used when referencing # it, which may be a subdirectory of the actual project. If you want the base # directory of the project, pass 'basepath=True'. -def getsrclib(spec, srclib_dir, sdk_path, basepath=False, raw=False, prepare=True, preponly=False): +def getsrclib(spec, srclib_dir, sdk_path, ndk_path="", mvn3="", basepath=False, raw=False, prepare=True, preponly=False): if raw: name = spec @@ -1028,8 +1028,12 @@ def getsrclib(spec, srclib_dir, sdk_path, basepath=False, raw=False, prepare=Tru if prepare: if srclib["Prepare"] is not None: - print "******************************* PREPARE " + srclib["Prepare"] + " **************" - p = subprocess.Popen(['bash', '-c', srclib["Prepare"]], cwd=libdir, + cmd = srclib["Prepare"].replace('$$SDK$$', sdk_path) + cmd = cmd.replace('$$NDK$$', ndk_path).replace('$$MVN$$', mvn3) + + print "******************************* PREPARE " + cmd + " **************" + + p = subprocess.Popen(['bash', '-c', cmd], cwd=libdir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() if p.returncode != 0: @@ -1242,7 +1246,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path, if 'srclibs' in build: for lib in build['srclibs'].split(';'): name, _ = lib.split('@') - srclibpaths.append((name, getsrclib(lib, srclib_dir, sdk_path, preponly=onserver))) + srclibpaths.append((name, getsrclib(lib, srclib_dir, sdk_path, ndk_path, mvn3, preponly=onserver))) basesrclib = vcs.getsrclib() # If one was used for the main source, add that too. if basesrclib: