chiark / gitweb /
Fix a couple gradle python mistakes
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 28 Jan 2014 13:14:18 +0000 (14:14 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 28 Jan 2014 13:14:18 +0000 (14:14 +0100)
fdroidserver/common.py

index fd2e1abc97feaf27086fea4e6b8e74c305cd96a3..3bca96d3c6666171e2912cb25a4167bae06385a7 100644 (file)
@@ -1013,12 +1013,14 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
         if flavour in ['main', 'yes', '']:
             flavour = None
 
-        if 'target' in thisbuild:
-            n = thisbuild["target"].split('-')[1]
+        if 'target' in build:
+            n = build["target"].split('-')[1]
             subprocess.call(['sed', '-i',
                 's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+n+'@g',
                 'build.gradle'], cwd=root_dir)
-            if '@' in thisbuild['gradle']:
+            if '@' in build['gradle']:
+                gradle_dir = os.path.join(root_dir, build['gradle'].split('@',1)[1])
+                gradle_dir = os.path.normpath(gradle_dir)
                 subprocess.call(['sed', '-i',
                     's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+n+'@g',
                     'build.gradle'], cwd=gradle_dir)