Commit bfa1555e authored by Yoni Fogel's avatar Yoni Fogel

Add local cache option to make.mysql.debug.env.bash

parent 45d645fb
...@@ -26,3 +26,4 @@ ...@@ -26,3 +26,4 @@
*.py[cod] *.py[cod]
.*.swp
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e -u
function usage() { function usage() {
echo "build a debug mysql in the current directory" echo "build a debug mysql in the current directory"
...@@ -12,12 +12,27 @@ function usage() { ...@@ -12,12 +12,27 @@ function usage() {
echo "--jemalloc=$jemalloc --jemalloc_tree=$jemalloc_tree" echo "--jemalloc=$jemalloc --jemalloc_tree=$jemalloc_tree"
echo "--backup=$backup --backup_tree=$backup_tree" echo "--backup=$backup --backup_tree=$backup_tree"
echo "--cc=$cc --cxx=$cxx" echo "--cc=$cc --cxx=$cxx"
echo "--local_cache_dir=$local_cache_dir --local_cache_update=$local_cache_update"
} }
function github_clone() { function github_clone() {
local repo=$1; local tree=$2 local repo=$1; local tree=$2
git clone git@github.com:Tokutek/$repo if [[ -z "$local_cache_dir" ]] ; then
if [ $? != 0 ] ; then exit 1; fi git clone git@github.com:Tokutek/$repo
if [ $? != 0 ] ; then exit 1; fi
else
if (( "$local_cache_update" )) ; then
pushd $local_cache_dir/$repo.git
git fetch --all -p -t
popd
fi
git clone $local_cache_dir/$repo.git
if [ $? != 0 ] ; then exit 1; fi
pushd $repo
git remote set-url origin git@github.com:Tokutek/$repo $local_cache_dir/$repo.git
popd
fi
pushd $repo pushd $repo
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
if [ -z $git_tag ] ; then if [ -z $git_tag ] ; then
...@@ -44,6 +59,8 @@ backup=backup-community ...@@ -44,6 +59,8 @@ backup=backup-community
backup_tree=master backup_tree=master
cc=gcc47 cc=gcc47
cxx=g++47 cxx=g++47
local_cache_dir=
local_cache_update=1
while [ $# -ne 0 ] ; do while [ $# -ne 0 ] ; do
arg=$1; shift arg=$1; shift
......
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