forked from grame-cncm/faust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version
executable file
·110 lines (93 loc) · 2.67 KB
/
version
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
#
# Faust project
# version management tool
#
function warn {
echo "WARNING ! This tools is intended to change the current version number"
echo "NOT to recall a previous Faust version !"
}
function major {
echo $1 | sed 's/\..*//'
}
function minor {
echo $1 | sed 's/[0-9]*\.\([0-9]*\)\..*/\1/'
}
function patch {
echo $1 | sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'
}
function winVer {
echo $1 | sed "s/\./,$2/g"
}
function rcUpdate {
sed "s/FILEVERSION[ ].*/FILEVERSION $2/" $1 | \
sed "s/PRODUCTVERSION[ ].*/PRODUCTVERSION $2/" | \
sed "s/VALUE \"FileVersion\"..*/VALUE \"FileVersion\", \"$3\"/" | \
sed "s/VALUE \"ProductVersion\"..*/VALUE \"ProductVersion\", \"$3\"/"
}
if [ $# -ne 1 ]
then
echo "Faust version management utility"
echo "usage: version version_num"
echo " version_num format: n.n.n"
warn
exit 1
fi
warn
echo "Type OK to continue... "
read CONT
[ "$CONT" == "OK" ] || exit 1
ROOT=.
VERSION=$1
MAJOR=$(major $VERSION)
MINOR=$(minor $VERSION)
PATCH=$(patch $VERSION)
WINVERS=$(winVer $VERSION)",0"
WINVERS2=$(winVer $VERSION " ")", 0"
if [ -d compiler ]
then
echo "moving version number to $VERSION"
else
echo "this script must be called from the Faust project root directory"
exit 1
fi
MAKEF=$ROOT/Makefile
echo " updating $MAKEF"
sed "s/^version *:= *..*/version := $VERSION/" $MAKEF > TMP$$
mv -f TMP$$ $MAKEF
MAKEF=$ROOT/build/Makefile
echo " updating $MAKEF"
sed "s/^VERSION *:= *..*/VERSION := $VERSION/" $MAKEF > TMP$$
mv -f TMP$$ $MAKEF
CMAKE=$ROOT/build/CMakeLists.txt
echo " updating $CMAKE"
sed "s/set (VERSION[ ]*[0-9].*)/set (VERSION $VERSION)/" $CMAKE > TMP$$
mv TMP$$ $CMAKE
MAKERELEASE=$ROOT/build/MakeRelease.bat
echo " updating $MAKERELEASE"
sed "s/^SET VERSION=[0-9].*/SET (VERSION=$VERSION)/" $MAKERELEASE > TMP$$
mv TMP$$ $MAKERELEASE
FAUST=$ROOT/compiler/generator/export.hh
echo " updating $FAUST"
sed "s/FAUSTVERSION[ ]\".*\"/FAUSTVERSION \"$VERSION\"/" $FAUST > TMP$$
mv -f TMP$$ $FAUST
FAUSTRC=$ROOT/windows/faust.rc
echo " updating $FAUSTRC"
rcUpdate $FAUSTRC $WINVERS "$WINVERS2" > TMP$$
mv -f TMP$$ $FAUSTRC
FAUSTDLLRC=$ROOT/windows/faustdll.rc
echo " updating $FAUSTDLLRC"
rcUpdate $FAUSTRC $WINVERS "$WINVERS2" > TMP$$
mv -f TMP$$ $FAUSTDLLRC
MAN=$ROOT/documentation/man/man-header.txt
echo " updating $MAN"
sed "s/% man(1) Version [ ]*[0-9].*/% man(1) Version $VERSION (`LC_ALL=C date +%d-%B-%Y`) | Faust man page/" $MAN > TMP$$
mv -f TMP$$ $MAN
COPYING=$ROOT/COPYING.txt
echo " updating $COPYING"
sed "s/FAUST compiler, Version[ ]*[0-9].*/FAUST compiler, Version $VERSION/" $COPYING > TMP$$
mv -f TMP$$ $COPYING
make man
echo $VERSION > version.txt
echo "### You need to recompile Faust for the change to take effect."
exit 0