forked from dosemu2/dosemu2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-tag.sh
executable file
·57 lines (53 loc) · 1.17 KB
/
make-tag.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: $0 2.0pre20"
exit 1
fi
SUFF=${0: -4}
if [ "$SUFF" != ".tmp" ]; then
# need to create a temporary version of the script so that
# changing the branch does not destroy it
TMP="/tmp/$0.tmp"
cp $0 $TMP
exec $TMP $@
fi
SUBV="$1"
shift
if [ "$1" = "-d" ]; then
DEV_ONLY=1
shift
fi
#VER="dosemu2-$SUBV"
VER="$SUBV"
REV=`git rev-list HEAD ^dosemu-1.5.0 --count`
echo $SUBV > VERSION
echo $REV >> VERSION
git commit VERSION -m "update version to $SUBV"
if [ $? != 0 ]; then
exit 1
fi
git tag -f -a $VER-dev -m "tag devel $VER"
if [ -n "$DEV_ONLY" ]; then
exit 0
fi
git stash
MWT=`git worktree list --porcelain | grep -B 3 "heads/master" | grep worktree \
|cut -d " " -f 2`
if [ -n "$MWT" ]; then
# unfortunately git does not allow checking out the branch that
# has a work-tree elsewhere
cd "$MWT"
git stash
else
git checkout master
if [ $? != 0 ]; then
echo Failure! Undoing...
git tag -d $VER-dev
git reset --h HEAD^
exit 1
fi
fi
git merge --no-ff --log -m "merge $SUBV release from devel" devel
git tag -f -a $VER -m "tag release $VER"
# remove temporary script
rm $0