blob: bd6da1df218a4ff7b6c36d512cf7b820b6d67aaa (
plain)
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
|
#! /bin/sh
#
# This script gets the version number from the configure.ac file and
# fills it in to other places where the version number is needed but
# cannot be filled in by the configure script.
#
version=`grep AC_INIT configure.ac | cut -d , -f 2 | cut -d ')' -f 1`
version=`echo $version`
version_1=`echo $version | cut -d . -f 1`
version_2=`echo $version | cut -d . -f 2`
version_3=`echo $version | cut -d . -f 3`
for file in python/setup.py \
win32/tre-config.h; do
cp $file.in $file.tmp
for replace in @TRE_VERSION@:$version \
@TRE_VERSION_1@:$version_1 \
@TRE_VERSION_2@:$version_2 \
@TRE_VERSION_3@:$version_3; do
var=`echo $replace | cut -d : -f 1`
val=`echo $replace | cut -d : -f 2`
echo "Replacing $var by $val to $file"
cat $file.tmp \
| sed "s/$var/$val/g" \
> $file.tmp2
mv $file.tmp2 $file.tmp
done
mv $file.tmp $file
done
|