Debian Codegraph @

scripts/version.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 plain=0
4 internal=0
5 case "${1}" in
6 "") ;;
7 --plain) plain=1;;
8 --internal) internal=1;;
9 *) printfscip-shell system . . printf. "${0##*/}: unknow option '%s'\n" "${1}" >&2; exit 1;;
10 esac
11 if [scip-shell system . . `[`. ${plain} -ne 0 -a ${internal} -ne 0 ]; then
12 printfscip-shell system . . printf. "Can't print both plain and internal" >&2
13 printfscip-shell system . . printf. " versions at the same time\n" >&2
14 exit 1
15 fi
16
17 ver_file="${0%/*}/../.version"
18 k_ver="$( headscip-shell system . . head. -n 1 "${ver_file}" |cutscip-shell system . . cut. -d ' ' -f 1 )"
19 k_cset="$( headscip-shell system . . head. -n 1 "${ver_file}" |cutscip-shell system . . cut. -d ' ' -f 2 )"
20 k_name="$( headscip-shell system . . head. -n 1 "${ver_file}" |cutscip-shell system . . cut. -d ' ' -f 3- )"
21 kf_ver="$( tailscip-shell system . . tail. -n 1 "${ver_file}" )"
22
23 if [scip-shell system . . `[`. ${internal} -ne 0 ]; then
24 printfscip-shell system . . printf. "%s\n" "${kf_ver}"
25 exit 0
26 fi
27
28 k_ver_plain="$( printfscip-shell system . . printf. "%s" "${k_ver}" \
29 |sed -e 's/-rc.*//;' )"
30
31 case "${kf_ver}" in
32 git) kf_ver="-$( gitscip-shell system . . git. rev-parse --short HEAD )"
33 k_ver_extra="$( printfscip-shell system . . printf. "_%-7.7s" "${k_cset}" )"
34 ;;
35 *) k_ver_extra="";;
36 esac
37
38 if [scip-shell system . . `[`. "${plain}" -eq 1 ]; then
39 echoscip-shell system . . echo. "${k_ver_plain}"
40 else
41 echoscip-shell system . . echo. "${k_ver}${k_ver_extra}.${kf_ver}"
42 fi
43