diff --git a/test-versioning.sh b/test-versioning.sh index 57b6a09ad..b7ff65331 100755 --- a/test-versioning.sh +++ b/test-versioning.sh @@ -4,6 +4,9 @@ set -eu +# Needed so sed doesn't report illegal byte sequences on macOS +export LC_CTYPE=C + ref_major=$(sed -ne 's/^#define SDL_MIXER_MAJOR_VERSION *//p' include/SDL_mixer.h) ref_minor=$(sed -ne 's/^#define SDL_MIXER_MINOR_VERSION *//p' include/SDL_mixer.h) ref_micro=$(sed -ne 's/^#define SDL_MIXER_PATCHLEVEL *//p' include/SDL_mixer.h) @@ -34,9 +37,9 @@ else not_ok "configure.ac $version disagrees with SDL_mixer.h $ref_version" fi -major=$(sed -ne 's/^set(MAJOR_VERSION \([0-9]\+\))$/\1/p' CMakeLists.txt) -minor=$(sed -ne 's/^set(MINOR_VERSION \([0-9]\+\))$/\1/p' CMakeLists.txt) -micro=$(sed -ne 's/^set(MICRO_VERSION \([0-9]\+\))$/\1/p' CMakeLists.txt) +major=$(sed -ne 's/^set(MAJOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt) +minor=$(sed -ne 's/^set(MINOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt) +micro=$(sed -ne 's/^set(MICRO_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt) version="${major}.${minor}.${micro}" if [ "$ref_version" = "$version" ]; then @@ -74,7 +77,7 @@ for rcfile in version.rc VisualC/Version.rc; do not_ok "$rcfile PRODUCTVERSION $tuple disagrees with SDL_mixer.h $ref_tuple" fi - tuple=$(sed -Ene 's/^ *VALUE "FileVersion", "([0-9, ]+)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r') + tuple=$(sed -Ene 's/^ *VALUE "FileVersion", "([0-9, ]*)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r') ref_tuple="${ref_major}, ${ref_minor}, ${ref_micro}, 0" if [ "$ref_tuple" = "$tuple" ]; then @@ -83,7 +86,7 @@ for rcfile in version.rc VisualC/Version.rc; do not_ok "$rcfile FileVersion $tuple disagrees with SDL_mixer.h $ref_tuple" fi - tuple=$(sed -Ene 's/^ *VALUE "ProductVersion", "([0-9, ]+)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r') + tuple=$(sed -Ene 's/^ *VALUE "ProductVersion", "([0-9, ]*)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r') if [ "$ref_tuple" = "$tuple" ]; then ok "$rcfile ProductVersion $tuple"