chiark / gitweb /
makebs: work around build-tools 24.0.1 version bug
[fdroidserver.git] / buildserver / provision-android-sdk
index 5560ecb18cf9b39d3f062de829c1f4643623ca10..57eacdc46ca4f73c2bace349691450eb3ebc6539 100644 (file)
@@ -1,7 +1,9 @@
 #!/bin/bash
 #
 
+echo $0
 set -e
+set -x
 
 if [ -z $ANDROID_HOME ]; then
     echo "ANDROID_HOME env var must be set!"
@@ -23,7 +25,7 @@ fi
 
 cd /vagrant/cache
 
-# make hard links for `android update sdk` to use and delete
+# make links for `android update sdk` to use and delete
 for f in android_*.zip android-[0-9]*.zip platform-[0-9]*.zip build-tools_r*-linux.zip; do
     rm -f ${ANDROID_HOME}/temp/$f
     ln -s /vagrant/cache/$f ${ANDROID_HOME}/temp/
@@ -39,10 +41,14 @@ done
 # install all cached build-tools
 for f in `ls -1 build-tools*.zip`; do
     ver=`unzip -c $f "*/source.properties" | sed -n 's,^Pkg.Revision=,,p'`
+    if [[ $ver == 24.0.0 ]] && [[ $f =~ .*r24\.0\.1.* ]]; then
+        # 24.0.1 has the wrong revision in the zip
+        ver=24.0.1
+    fi
     cached=,build-tools-${ver}${cached}
 done
 
-${ANDROID_HOME}/tools/android --silent update sdk --no-ui --all \
+${ANDROID_HOME}/tools/android update sdk --no-ui --all \
     --filter platform-tools,extra-android-m2repository${cached} <<EOH
 y