summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@qt.io>2019-07-31 12:05:34 +0200
committerDimitrios Apostolou <jimis@qt.io>2019-09-26 20:11:56 +0200
commite6fccbf2407bcb7f4006fd70a2af16451e3a44f1 (patch)
treeef89e382bd500fd024d3134f794df49b47bf5155
parentcb8e769cf611f519a45e11697ea27ad1e4b963b3 (diff)
Remove the progress bar from the sdkmanager output
Cleans up many thousands of useless lines from the logs. Change-Id: I2673f65b713996637d2161da4db726823e17c0df Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
-rwxr-xr-xcoin/provisioning/common/linux/android_linux.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/coin/provisioning/common/linux/android_linux.sh b/coin/provisioning/common/linux/android_linux.sh
index 5840d4b4..b83c1c6e 100755
--- a/coin/provisioning/common/linux/android_linux.sh
+++ b/coin/provisioning/common/linux/android_linux.sh
@@ -80,14 +80,22 @@ else
sudo chown -R qt:users "$targetFolder"
fi
+# Run the following command under `eval` or `sh -c` so that the shell properly splits it
+sdkmanager_no_progress_bar_cmd="tr '\r' '\n' | grep -v '^\[[ =]*\]'"
+
echo "Running SDK manager for platforms;$sdkApiLevel, platform-tools and build-tools;$sdkBuildToolsVersion."
# shellcheck disable=SC2031
if [ "$http_proxy" != "" ]; then
proxy_host=$(echo "$proxy" | cut -d'/' -f3 | cut -d':' -f1)
proxy_port=$(echo "$proxy" | cut -d':' -f3)
- echo "y" |"$sdkTargetFolder/tools/bin/sdkmanager" --no_https --proxy=http --proxy_host="$proxy_host" --proxy_port="$proxy_port" "platforms;$sdkApiLevel" "platform-tools" "build-tools;$sdkBuildToolsVersion"
+ echo "y" | "$sdkTargetFolder/tools/bin/sdkmanager" \
+ --no_https --proxy=http --proxy_host="$proxy_host" --proxy_port="$proxy_port" \
+ "platforms;$sdkApiLevel" "platform-tools" "build-tools;$sdkBuildToolsVersion" \
+ | eval $sdkmanager_no_progress_bar_cmd
else
- echo "y" |"$sdkTargetFolder/tools/bin/sdkmanager" "platforms;$sdkApiLevel" "platform-tools" "build-tools;$sdkBuildToolsVersion"
+ echo "y" | "$sdkTargetFolder/tools/bin/sdkmanager" \
+ "platforms;$sdkApiLevel" "platform-tools" "build-tools;$sdkBuildToolsVersion" \
+ | eval $sdkmanager_no_progress_bar_cmd
fi
echo "Checking the contents of Android SDK..."
@@ -106,8 +114,11 @@ echo "Android SDK API level = $sdkApiLevel" >> ~/versions.txt
echo "Android NDK = $ndkVersion" >> ~/versions.txt
cd "$sdkTargetFolder/tools/bin"
-./sdkmanager --install "emulator"
-echo "y" | ./sdkmanager --install "system-images;android-21;google_apis;x86"
+./sdkmanager --install "emulator" \
+ | eval $sdkmanager_no_progress_bar_cmd
+echo "y" | ./sdkmanager --install "system-images;android-21;google_apis;x86" \
+ | eval $sdkmanager_no_progress_bar_cmd
+
echo "Checking the contents of Android SDK again..."
ls -l "$sdkTargetFolder"