chiark / gitweb /
metadata output-lines now substitute $$VERSION$$/etc.
authorMichael Pöhn <michael.poehn@fsfe.org>
Thu, 16 Mar 2017 08:23:28 +0000 (09:23 +0100)
committerMichael Pöhn <michael.poehn@fsfe.org>
Thu, 16 Mar 2017 08:24:05 +0000 (09:24 +0100)
fdroidserver/build.py
fdroidserver/common.py
tests/metadata/fake.ota.update.txt

index 00a20cf6cd5b81bc365609b0bcd28f78bd25f047..a90f532e74fd7cdcb93d026722b36ad12d61de83 100644 (file)
@@ -859,7 +859,8 @@ def build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir,
                        re.S | re.M).group(1)
         src = os.path.join(bindir, src)
     elif omethod == 'raw':
-        globpath = os.path.join(root_dir, build.output)
+        output_path = common.replace_build_vars(build.output, build)
+        globpath = os.path.join(root_dir, output_path)
         apks = glob.glob(globpath)
         if len(apks) > 1:
             raise BuildException('Multiple apks match %s' % globpath, '\n'.join(apks))
index b8a506a55c5495ca2d7dacb11ce8d46d80adb0b7..e18cad48e6e430ea61167b342b4220d7de6642d0 100644 (file)
@@ -1917,15 +1917,20 @@ def set_FDroidPopen_env(build=None):
             env[n] = build.ndk_path()
 
 
+def replace_build_vars(cmd, build):
+    cmd = cmd.replace('$$COMMIT$$', build.commit)
+    cmd = cmd.replace('$$VERSION$$', build.versionName)
+    cmd = cmd.replace('$$VERCODE$$', build.versionCode)
+    return cmd
+
+
 def replace_config_vars(cmd, build):
     cmd = cmd.replace('$$SDK$$', config['sdk_path'])
     cmd = cmd.replace('$$NDK$$', build.ndk_path())
     cmd = cmd.replace('$$MVN3$$', config['mvn3'])
     cmd = cmd.replace('$$QT$$', config['qt_sdk_path'] or '')
     if build is not None:
-        cmd = cmd.replace('$$COMMIT$$', build.commit)
-        cmd = cmd.replace('$$VERSION$$', build.versionName)
-        cmd = cmd.replace('$$VERCODE$$', build.versionCode)
+        cmd = replace_build_vars(cmd, build)
     return cmd
 
 
index 264ba83327b3e72af2b3713098ecf2271e52e080..165da01484f575b94404da0a1293542a5d2e4085 100644 (file)
@@ -33,7 +33,7 @@ Repo:https://gitlab.com/fdroid/privileged-extension.git
 
 Build:0.2.1,2000
     commit=0.2.1
-    output=app/build/distributions/FDroidPrivilegedExtensionFromBinaries-0.2.1.zip
+    output=app/build/distributions/FDroidPrivilegedExtensionFromBinaries-$$VERSION$$.zip
     build=gradle assembleUpdateZipFromBinariesDebug
 
 Auto Update Mode:Version %v