Commit c276ee49 authored by Leif Walsh's avatar Leif Walsh

#10 misc fixes to new build script

parent e25b127d
function retry() {
set +e
local cmd
local retries
local exitcode
cmd=$*
let retries=0
while [ $retries -le 10 ] ; do
echo `date` $cmd
bash -c "$cmd"
exitcode=$?
echo `date` $cmd $exitcode $retries
let retries=retries+1
if [ $exitcode -eq 0 ] ; then break; fi
sleep 10
done
set -e
test $exitcode = 0
}
github_use_ssh=0
github_token=
github_user=
function github_download() {
repo=$1; shift
rev=$1; shift
......@@ -63,6 +87,19 @@ function github_download() {
fi
}
# returns b if b is defined else returns a
function git_tree() {
set +u
local a=$1; shift
local b=$1; shift
if [ ! -z $b ] ; then
echo $b
else
echo $a;
fi
set -u
}
# compute the number of cpus in this system. used to parallelize the build.
function get_ncpus() {
if [ -f /proc/cpuinfo ]; then
......
......@@ -13,7 +13,6 @@ system=$(uname -s | tr '[:upper:]' '[:lower:]')
arch=$(uname -m | tr '[:upper:]' '[:lower:]')
makejobs=$(get_ncpus)
github_use_ssh=0
git_tag=HEAD
mysqlbuild=
mysql=mysql-5.5.30
......@@ -110,9 +109,9 @@ if [ ! -d storage/tokudb/ft-index/third_party/jemalloc ] ; then
fi
# append tokudb-specific version
if grep -qv tokudb VERSION ; then
if [ $(fgrep tokudb VERSION | wc -l) = 0 ] ; then
# append the tokudb version to the MYSQL_VERSION_EXTRA variable in the VERSION file
sed -i "" -e"s/^MYSQL_VERSION_EXTRA=.*/&-tokudb-${tokudb_version}/" VERSION
sed --in-place="" -e "s/^MYSQL_VERSION_EXTRA=.*/&-tokudb-${tokudb_version}/" VERSION
fi
# prints a cmake command to eval
......@@ -159,10 +158,10 @@ function generate_cmake_cmd () {
linux_distro=linux
if [ -f /etc/issue ] ; then
if [[ "$(head -1 /etc/issue)" =~ "Red Hat Enterprise Linux Server release ([56])" ]] ; then
linux_distro=rhel${BASH_REMATCH[1])
linux_distro=rhel${BASH_REMATCH[1]}
fi
if [[ "$(head -1 /etc/issue)" =~ "CentOS release ([56])" ]] ; then
linux_distro=centos${BASH_REMATCH[1])
linux_distro=centos${BASH_REMATCH[1]}
fi
fi
echo -n " " -D RPM=$linux_distro
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment