-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathmake_src_tar
More file actions
executable file
·135 lines (116 loc) · 3.19 KB
/
Copy pathmake_src_tar
File metadata and controls
executable file
·135 lines (116 loc) · 3.19 KB
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
#!/bin/bash
#
# $Id: make_src_tar 1932 2013-06-20 18:26:27Z dhill $
#
# basedir is the working dir for all the activity
basedir=$HOME
# vname is the name of the top-level dir in the tar file
vname=
# ofile is the output tar file name and is relative to a hidden dir, so it should be absolute
ofile=
# branch is the branch to checkout (develop by default)
branch=
for arg in "$@"; do
if [ $(expr -- "$arg" : '--basedir=') -eq 10 ]; then
basedir="$(echo $arg | awk -F= '{print $2}')"
elif [ $(expr -- "$arg" : '--vname=') -eq 8 ]; then
vname="$(echo $arg | awk -F= '{print $2}')"
elif [ $(expr -- "$arg" : '--ofile=') -eq 8 ]; then
ofile="$(echo $arg | awk -F= '{print $2}')"
elif [ $(expr -- "$arg" : '--branch=') -eq 9 ]; then
branch="$(echo $arg | awk -F= '{print $2}')"
else
echo "ignoring unknown argument: $arg" 1>&2
fi
done
if [ -f releasenum ]; then
. releasenum
elif [ -f build/releasenum ]; then
. build/releasenum
else
echo "Couldn't locate 'releasenum' file in the build dir, make sure running in top-level dir"
fi
if [ -z "$version" ]; then
echo "Version defaulting to 4.0-develop"
version=4.0
release=develop
fi
if [ -z "$release" ]; then
release=0
fi
blddir=bld.$$
if [ -z "$vname" ]; then
vname=infinidb-${version}
fi
if [ -z "$ofile" ]; then
ofile=${basedir}/${vname}-${release}.src.tar.gz
fi
co_dir=$blddir/$vname
trap "{ echo; cd ${basedir}; rm -rf $blddir; exit 1; }" TERM INT ERR
cd ${basedir}
rm -rf $blddir
mkdir -p $co_dir
cd $co_dir
branch_arg=
if [ ! -z "$branch" ]; then
branch_arg="-b $branch"
else
branch=develop
fi
echo -n "getting git source from $branch..."
git clone http://srvengcm1.calpont.com/repos/infinidb.git infinidb
cd infinidb
git checkout $branch
echo "done."
test -d build || exit 1
echo -n "cleaning git source for "
echo -n "release..."
rm -rf .git .gitignore
rm -rf qa export
rm -f rules.mak
find . -name Makefile | xargs rm -f
find . -name \*.xmi | xargs rm -f
rm -f dbcon/joblist/bandeddl.h.set dbcon/joblist/bandeddl.h.vector primitives/blockcache/iomanager.cpp.single-read \
primitives/udf/Makefile.sdk
rm -rf utils/scenarios
cd mysql
rm -rf scripts queries storage/maria
cd ..
rm -rf writeengine/test/*
rm -rf utils/net-snmp-built-libs
rm -rf utils/multicast
rm -rf utils/openpgm
rm -rf tools/reserveStacks
rm -rf dbcon/doc dbcon/ingres dbcon/plsql
cd tools
rm -rf brmtest dataPump evalidx fixdate nettest pgm pingproc rebuildEM snconvert updateGenii valprint
rm -rf cfread dbgen dbgen-ssb ddldriver dmldriver idb_comp sendPlan vbgen
cd ..
rm -rf utils/libstatgrab utils/libxml utils/testbc utils/configcpp/md5
echo "done."
cd ..
echo -n "getting MySQL..."
git clone https://github.com/infinidb/mysql mysql
cd mysql
git checkout $branch
echo "done."
cd ..
echo -n "building tarball..."
cd infinidb
cp -r utils/autoconf/* .
cp INSTALL INSTALL.keep
cp install-sh install-sh.keep
rm -rf utils/autoconf
autoreconf --force --install
rm -f INSTALL install-sh
mv INSTALL.keep INSTALL
mv install-sh.keep install-sh
cd ..
ln -s infinidb/INSTALL
ln -s infinidb/README
cd ..
tar -zcf $ofile $vname
echo "done."
echo "tarball left in $ofile"
cd ${basedir}
rm -rf $blddir