1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-06-03 06:10:10 +02:00

gradlew-fdroid: support parsing files with no EOL before EOF

Fixes cases like: https://gitlab.com/fdroid/fdroiddata/merge_requests/6216#note_273985937
This commit is contained in:
Marcus Hoffmann 2020-01-21 11:15:51 +01:00
parent fdcb1ad23f
commit 09db493557

View File

@ -156,7 +156,7 @@ v_all=${plugin_v[@]}
# Earliest takes priority
for f in {.,..}/gradle/wrapper/gradle-wrapper.properties; do
[[ -f $f ]] || continue
while read -r line; do
while IFS='' read -r line || [ -n "$line" ]; do
if [[ $line == 'distributionUrl='* ]]; then
wrapper_ver=${line#*/gradle-}
wrapper_ver=${wrapper_ver%-*.zip}
@ -174,7 +174,7 @@ fi
# Earliest takes priority
for f in {.,..}/build.gradle; do
[[ -f $f ]] || continue
while read -r line; do
while IFS='' read -r line || [ -n "$line" ]; do
if [[ -z "$plugin_pver" && $line == *'com.android.tools.build:gradle:'* ]]; then
plugin_pver=${line#*[\'\"]com.android.tools.build:gradle:}
plugin_pver=${plugin_pver%[\'\"]*}