mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	gradlew-fdroid: fix parsing when files have Windows linefeeds
The new test file should have Windows linefeeds, if I got the git config correct.
This commit is contained in:
		
							parent
							
								
									fc885c9b5c
								
							
						
					
					
						commit
						7a84679b0d
					
				
					 3 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -168,6 +168,7 @@ for f in {.,..}/gradle/wrapper/gradle-wrapper.properties; do
 | 
			
		|||
        if [[ $line == 'distributionUrl='* ]]; then
 | 
			
		||||
            wrapper_ver=${line#*/gradle-}
 | 
			
		||||
            wrapper_ver=${wrapper_ver%-*.zip}
 | 
			
		||||
            wrapper_ver=$(printf $wrapper_ver | tr -d '\r') # strip Windows linefeeds
 | 
			
		||||
            break 2
 | 
			
		||||
        fi
 | 
			
		||||
    done < $f
 | 
			
		||||
| 
						 | 
				
			
			@ -186,9 +187,11 @@ for f in {.,..}/build.gradle{,.kts}; do
 | 
			
		|||
        if [[ -z "$plugin_pver" && $line == *'com.android.tools.build:gradle:'* ]]; then
 | 
			
		||||
            plugin_pver=${line#*[\'\"]com.android.tools.build:gradle:}
 | 
			
		||||
            plugin_pver=${plugin_pver%[\'\"]*}
 | 
			
		||||
            plugin_pver=$(printf $plugin_pver | tr -d '\r') # strip Windows linefeeds
 | 
			
		||||
        elif [[ -z "$wrapper_ver" && $line == *'gradleVersion = '* ]]; then
 | 
			
		||||
            wrapper_ver=${line#*gradleVersion*=*[\'\"]}
 | 
			
		||||
            wrapper_ver=${wrapper_ver%[\'\"]*}
 | 
			
		||||
            wrapper_ver=$(printf $wrapper_ver | tr -d '\r') # strip Windows linefeeds
 | 
			
		||||
        fi
 | 
			
		||||
    done < $f
 | 
			
		||||
done
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										6
									
								
								tests/source-files/yuriykulikov/AlarmClock/gradle/wrapper/gradle-wrapper.properties
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								tests/source-files/yuriykulikov/AlarmClock/gradle/wrapper/gradle-wrapper.properties
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,6 @@
 | 
			
		|||
#Wed Jan 30 10:59:12 CET 2019
 | 
			
		||||
distributionBase=GRADLE_USER_HOME
 | 
			
		||||
distributionPath=wrapper/dists
 | 
			
		||||
zipStoreBase=GRADLE_USER_HOME
 | 
			
		||||
zipStorePath=wrapper/dists
 | 
			
		||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
 | 
			
		||||
| 
						 | 
				
			
			@ -19,8 +19,13 @@ exit_value=0
 | 
			
		|||
basedir=$(cd $(dirname $0)/..; pwd)
 | 
			
		||||
export https_proxy=127.7.7.7:7 # fake proxy to block downloading
 | 
			
		||||
 | 
			
		||||
# force test file to have Windows linefeeds
 | 
			
		||||
sed -i -e $'s/\r$//' -e  $'s/$/\r/' \
 | 
			
		||||
    $basedir/tests/source-files/yuriykulikov/AlarmClock/gradle/wrapper/gradle-wrapper.properties
 | 
			
		||||
 | 
			
		||||
run_test osmandapp/osmand 2.2.1
 | 
			
		||||
run_test com.integreight.onesheeld 3.3
 | 
			
		||||
run_test se.manyver/android 5.5
 | 
			
		||||
run_test yuriykulikov/AlarmClock 5.1.1
 | 
			
		||||
 | 
			
		||||
exit $exit_value
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue