-
Notifications
You must be signed in to change notification settings - Fork 326
/
version
executable file
·141 lines (119 loc) · 3.9 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/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
LIBFAUSTACTION=$ROOT/.github/workflows/libfaust.yml
echo " updating $LIBFAUSTACTION"
sed "s/FAUST_VERSION*: *..*/FAUST_VERSION: $VERSION/" $LIBFAUSTACTION > TMP$$
mv -f TMP$$ $LIBFAUSTACTION
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/architecture/faust/export.h
echo " updating $FAUST"
sed "s/FAUSTVERSION[ ]\".*\"/FAUSTVERSION \"$VERSION\"/" $FAUST > TMP$$
mv -f TMP$$ $FAUST
sed "s/FAUSTMAJORVERSION[ ].*/FAUSTMAJORVERSION $MAJOR/" $FAUST > TMP$$
mv -f TMP$$ $FAUST
sed "s/FAUSTMINORVERSION[ ].*/FAUSTMINORVERSION $MINOR/" $FAUST > TMP$$
mv -f TMP$$ $FAUST
sed "s/FAUSTPATCHVERSION[ ].*/FAUSTPATCHVERSION $PATCH/" $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
DOXYFILE1=$ROOT/documentation/libfaust/Doxyfile
echo " updating $DOXYFILE1"
sed "s/PROJECT_NUMBER = [ ]*[0-9].*/PROJECT_NUMBER = $VERSION/" $DOXYFILE1 > TMP$$
mv -f TMP$$ $DOXYFILE1
DOXYFILE2=$ROOT/compiler/Doxyfile
echo " updating $DOXYFILE2"
sed "s/PROJECT_NUMBER = [ ]*[0-9].*/PROJECT_NUMBER = $VERSION/" $DOXYFILE2 > TMP$$
mv -f TMP$$ $DOXYFILE2
DOXYFILE3=$ROOT/documentation/libfaustremote/Doxyfile
echo " updating $DOXYFILE3"
sed "s/PROJECT_NUMBER = [ ]*[0-9].*/PROJECT_NUMBER = $VERSION/" $DOXYFILE3 > TMP$$
mv -f TMP$$ $DOXYFILE3
DOXYFILE4=$ROOT/documentation/compiler/Doxyfile
echo " updating $DOXYFILE4"
sed "s/PROJECT_NUMBER = [ ]*[0-9].*/PROJECT_NUMBER = $VERSION/" $DOXYFILE4 > TMP$$
mv -f TMP$$ $DOXYFILE4
make man
echo $VERSION > version.txt
echo "### You need to recompile Faust for the change to take effect."
exit 0