-
Notifications
You must be signed in to change notification settings - Fork 6
/
build_it
executable file
·76 lines (60 loc) · 1008 Bytes
/
build_it
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
#! /bin/bash -e
unset LANG
branch=master
while true ; do
if [ "$1" = "--target" ] ; then
target="--target $2"
shift
shift
continue
fi
if [ "$1" = "--branch" ] ; then
branch=$2
shift
shift
continue
fi
if [ "$1" = "--prepare" ] ; then
prepare="$2"
shift
shift
continue
fi
if [ "$1" = "--spec" ] ; then
spec_opt="--spec $2"
shift
shift
continue
fi
if [ "$1" = "--obs" ] ; then
obs_opt="--obs $2"
shift
shift
continue
fi
if [ "$1" = "--no-tag" ] ; then
tag_opt="--no-tag"
shift
continue
fi
break
done
git status
git checkout $branch
git pull
if [ -z "$prepare" ] ; then
clean_target=clean
grep -q -s distclean: Makefile* && clean_target=distclean
make $clean_target
if [ -d package ] ; then
echo 'old archive files found!'
exit 1
fi
make archive
else
$prepare
fi
tobs $target $spec_opt $obs_opt $tag_opt
if [ -z "$prepare" ] ; then
make $clean_target
fi