| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | GRN_VERSION_SH="$(pwdscip-shell system . . pwd.)/version.sh" |
| 4 | |
| 5 | case "$0" in |
| 6 | */*) |
| 7 | cd `dirnamescip-shell system . . dirname. $0` |
| 8 | ;; |
| 9 | esac |
| 10 | |
| 11 | if testscip-shell system . . test. -f full_version; then |
| 12 | GRN_VN=$(catscip-shell system . . cat. full_version) |
| 13 | elif testscip-shell system . . test. -d .git -o -f .git; then |
| 14 | GRN_VN=$(gitscip-shell system . . git. describe --abbrev=7 HEAD 2>/dev/nullscip-shell filesystem . . `/dev/null`.) |
| 15 | if [scip-shell system . . `[`. $? -ne 0 ]; then |
| 16 | GRN_VN=$(catscip-shell system . . cat. base_version) |
| 17 | fi |
| 18 | else |
| 19 | GRN_VN=$(catscip-shell system . . cat. base_version) |
| 20 | fi |
| 21 | |
| 22 | GRN_VN=$(exprscip-shell system . . expr. "$GRN_VN" : v*'\(.*\)') |
| 23 | |
| 24 | if testscip-shell system . . test. -r "${GRN_VERSION_SH}"; then |
| 25 | GRN_VN_OLD=$(sedscip-shell system . . sed. -E -e 's/^GRN_VERSION(_FULL)?=//' "${GRN_VERSION_SH}") |
| 26 | else |
| 27 | GRN_VN_OLD=unset |
| 28 | fi |
| 29 | |
| 30 | if testscip-shell system . . test. "$GRN_VN_OLD" != "$GRN_VN"; then |
| 31 | echoscip-shell system . . echo. "GRN_VERSION_FULL=$GRN_VN" > "${GRN_VERSION_SH}" |
| 32 | fi |