mwrap.git  about / heads / tags
LD_PRELOAD malloc wrapper + line stats for Ruby
blob ae66e94b7e38fe329058b9827b908b1a3ee99609 522 bytes (raw)
$ git show v2.3.0:VERSION-GEN	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
#!/bin/sh
VF=lib/mwrap/version.rb
DEF_VER=v2.3.0
VN=$(git describe HEAD 2>/dev/null)
if test $? -eq 0
then
	case "$VN" in
	v[0-9]*)
		set -e
		git update-index -q --refresh
		set +e
		git diff-index --quiet HEAD -- || VN="$VN-dirty"
		set -e
		VN=$(echo $VN | tr '-' '.')
		;;
	esac
fi
set -e

case $VN in
'') VN="$DEF_VER" ;;
esac

VN=$(expr "$VN" : v*'\(.*\)')
VC=unset
if test -r $VF
then
	VC="$(cat $VF)"
fi

new="module Mwrap; VERSION = '$VN'.freeze; end"
if test x"$new" != x"$VC"
then
	echo "$new" >$VF
fi
echo $VN

git clone https://80x24.org/mwrap.git