diff options
| author | 3gg <3gg@shellblade.net> | 2026-03-06 13:30:59 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2026-03-06 13:30:59 -0800 |
| commit | 30f41c02aec763d32e62351452da9ef582bc3472 (patch) | |
| tree | 6bec3f65bfdcbf7f1a631da21a6d613bef5db2fa /contrib/SDL-3.2.8/build-scripts/showrev.sh | |
| parent | 452ff21ca02e315c64ceeb3f21c1ea357aeb1bc8 (diff) | |
Move contrib libraries to contrib repo
Diffstat (limited to 'contrib/SDL-3.2.8/build-scripts/showrev.sh')
| -rwxr-xr-x | contrib/SDL-3.2.8/build-scripts/showrev.sh | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/contrib/SDL-3.2.8/build-scripts/showrev.sh b/contrib/SDL-3.2.8/build-scripts/showrev.sh deleted file mode 100755 index 764d3a4..0000000 --- a/contrib/SDL-3.2.8/build-scripts/showrev.sh +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # Print the current source revision, if available | ||
| 4 | |||
| 5 | SDL_ROOT=$(dirname $0)/.. | ||
| 6 | cd $SDL_ROOT | ||
| 7 | |||
| 8 | if [ -e ./VERSION.txt ]; then | ||
| 9 | cat ./VERSION.txt | ||
| 10 | exit 0 | ||
| 11 | fi | ||
| 12 | |||
| 13 | major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' include/SDL3/SDL_version.h) | ||
| 14 | minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' include/SDL3/SDL_version.h) | ||
| 15 | micro=$(sed -ne 's/^#define SDL_MICRO_VERSION *//p' include/SDL3/SDL_version.h) | ||
| 16 | version="${major}.${minor}.${micro}" | ||
| 17 | |||
| 18 | if [ -x "$(command -v git)" ]; then | ||
| 19 | rev="$(git describe --tags --long 2>/dev/null)" | ||
| 20 | if [ -n "$rev" ]; then | ||
| 21 | # e.g. release-2.24.0-542-g96361fc47 | ||
| 22 | # or release-2.24.1-5-g36b987dab | ||
| 23 | # or prerelease-2.23.2-0-gcb46e1b3f | ||
| 24 | echo "$rev" | ||
| 25 | exit 0 | ||
| 26 | fi | ||
| 27 | |||
| 28 | rev="$(git describe --always --tags --long 2>/dev/null)" | ||
| 29 | if [ -n "$rev" ]; then | ||
| 30 | # Just a truncated sha1, e.g. 96361fc47. | ||
| 31 | # Turn it into e.g. 2.25.0-g96361fc47 | ||
| 32 | echo "${version}-g${rev}" | ||
| 33 | exit 0 | ||
| 34 | fi | ||
| 35 | fi | ||
| 36 | |||
| 37 | if [ -x "$(command -v p4)" ]; then | ||
| 38 | rev="$(p4 changes -m1 ./...\#have 2>/dev/null| awk '{print $2}')" | ||
| 39 | if [ $? = 0 ]; then | ||
| 40 | # e.g. 2.25.0-p7511446 | ||
| 41 | echo "${version}-p${rev}" | ||
| 42 | exit 0 | ||
| 43 | fi | ||
| 44 | fi | ||
| 45 | |||
| 46 | # best we can do | ||
| 47 | echo "${version}-no-vcs" | ||
| 48 | exit 0 | ||
