FreeCalypso > hg > fc-magnetite
comparison scripts/src-version.sh @ 576:3cb2ce6e996a
scripts/src-version.sh: implemented wrapper around hg id
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 27 Jan 2019 22:20:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
575:0198ac1e1a4f | 576:3cb2ce6e996a |
---|---|
1 #!/bin/sh | |
2 | |
3 tmpfile=/tmp/fc_hg_id$$ | |
4 | |
5 hg id -in > $tmpfile 2> /dev/null | |
6 if [ $? != 0 ] | |
7 then | |
8 rm -f $tmpfile | |
9 echo unknown | |
10 exit 0 | |
11 fi | |
12 | |
13 read global local < $tmpfile | |
14 rm -f $tmpfile | |
15 | |
16 global_noplus=`echo $global | tr -d +` | |
17 local_noplus=`echo $local | tr -d +` | |
18 | |
19 if [ "$global" = "$global_noplus" -a "$local" = "$local_noplus" ] | |
20 then | |
21 dirty= | |
22 else | |
23 dirty=-dirty | |
24 fi | |
25 | |
26 echo $local_noplus:$global_noplus$dirty |