diff options
author | Timo Teräs <timo.teras@iki.fi> | 2023-02-28 14:39:09 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2023-02-28 14:43:35 +0200 |
commit | fd8f39f1d54c3b56d16a494898e5a753e2c71715 (patch) | |
tree | e926627298ba66b1d663b09979ecf3fa68a1fe92 /test/version.sh | |
parent | 48b4565f344e0ced9d23f612f8938b861c6886a4 (diff) | |
download | apk-tools-fd8f39f1d54c3b56d16a494898e5a753e2c71715.tar.gz apk-tools-fd8f39f1d54c3b56d16a494898e5a753e2c71715.tar.bz2 apk-tools-fd8f39f1d54c3b56d16a494898e5a753e2c71715.tar.xz apk-tools-fd8f39f1d54c3b56d16a494898e5a753e2c71715.zip |
version: fix leading zero stripping
Only the leading zeroes should be ignored. Handle properly if the
version component is actually zero.
fixes #10880
Diffstat (limited to 'test/version.sh')
-rwxr-xr-x | test/version.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/version.sh b/test/version.sh index 18199a6..f639e19 100755 --- a/test/version.sh +++ b/test/version.sh @@ -1,16 +1,18 @@ #!/bin/sh fail=0 -cat version.data | while read a result b rest ; do +while read a result b rest ; do output="$(../src/apk version -t "$a" "$b")" if [ "$output" != "$result" ] ; then echo "$a $result $b, but got $output" - fail=$(($fail+1)) + fail=$((fail+1)) fi -done +done < version.data if [ "$fail" == "0" ]; then echo "OK: version checking works" +else + echo "FAIL: $fail version checks failed" fi exit $fail |