forked from ozgurbtr/filterfs
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbootstrap.sh
executable file
·43 lines (30 loc) · 918 Bytes
/
bootstrap.sh
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
#!/bin/bash
REVISION=1
if [ -n "$1" ]; then
REVISION=$1
fi
CURRENTVERSION=$(git describe |sed -s 's/-.*$//')
#CURRENTVERSION=$(git tag|tail -1)
NEXTVERSION=""
function incrementVersion {
PRE=$(echo $CURRENTVERSION|sed -e 's/\.[0-9]\+$//'|sed -e 's/^v//')
LAST=$(echo $CURRENTVERSION|sed -e 's/^v[0-9]\+\.[0-9]\+\.//')
NEXTVERSION="$PRE"".""$(( $LAST + 1 ))"
}
function applyTemplate {
local TMPL=$1
local OUT=$2
local TMPFILE="$OUT""~"
cp -af $TMPL $TMPFILE
sed -i -e "s/%%%VERSION%%%/$NEXTVERSION/g" $TMPFILE
sed -i -e "s/%%%REVISION%%%/$REVISION/g" $TMPFILE
mv -f $TMPFILE $OUT
}
incrementVersion
echo "Current version is $NEXTVERSION-$REVISION"
applyTemplate configure.ac.tmpl configure.ac
applyTemplate debian/changelog.tmpl debian/changelog
echo $NEXTVERSION > package_version
echo $REVISION > package_revision
git submodule update --init --recursive
autoreconf -f -i