summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShireesh Anjal <anjalshireesh@gmail.com>2011-12-08 02:35:43 -0800
committerShireesh Anjal <anjalshireesh@gmail.com>2011-12-08 02:35:43 -0800
commitd02ab18242a67bf09a989bcfc2980a82e8f827b4 (patch)
tree79e827e0a69a99f70bd4617832993ba03462435a
parentc35b86741865e65ff18d0b9fa06509c5d2dd35de (diff)
parent7ec7bc017a85ca6c704cf15ce6b2684826d908b5 (diff)
Merge pull request #15 from balamurugana/master
gmc-build.sh accepts BUILD-DIR as optional argument. It uses gmc-target as GMC-TARGET-DIR and gmc-build as BUILD-DIR at source directory level if its not given.
-rwxr-xr-xbuild/gmc-build.sh35
1 files changed, 21 insertions, 14 deletions
diff --git a/build/gmc-build.sh b/build/gmc-build.sh
index b248c5c..734a1e0 100755
--- a/build/gmc-build.sh
+++ b/build/gmc-build.sh
@@ -194,7 +194,7 @@ function show_help()
{
cat <<EOF
-Usage: $ME [-f] [-h] [GMC-TARGET-DIR]
+Usage: $ME [-f] [-h] [GMC-TARGET-DIR] [BUILD-DIR]
Build Gluster Management Console from source.
@@ -205,8 +205,9 @@ Miscellaneous:
-h display this help and exit
Example:
- $ME gmc-build
- $ME gmc-build ~/gmc-target
+ $ME
+ $ME ~/gmc-target
+ $ME ~/gmc-target ~/gmc-build
EOF
}
@@ -241,21 +242,28 @@ function main()
shift `expr $OPTIND - 1`
# We want only one non-option argument.
- if [ $# -gt 1 ]; then
+ if [ $# -gt 2 ]; then
show_help
exit 1
fi
- gmc_target_dir=$1
-
src_dir=$(dirname $(dirname $(readlink -e $0)))
- build_dir=$PWD/.gmc-build
+ parent_dir=$(dirname $src_dir)
+
+ gmc_target_dir=$1
+ build_dir=$2
if [ -z "$gmc_target_dir" ]; then
- gmc_target_dir=$PWD/gmc-target
- if [ ! -e "$gmc_target_dir" ]; then
- git clone $GMC_TARGET_URL $gmc_target_dir
- fi
+ gmc_target_dir=$parent_dir/gmc-target
+ fi
+
+ if [ -z "$build_dir" ]; then
+ build_dir=$parent_dir/gmc-build
+ fi
+
+ if [ ! -e "$gmc_target_dir" ]; then
+ echo "Getting gmc-target from $GMC_TARGET_URL"
+ git clone $GMC_TARGET_URL $gmc_target_dir
fi
if [ "$force" = "yes" ]; then
@@ -285,8 +293,7 @@ function main()
configure_workspace
build
- mv ${DIST_BASE}/gmg/gmg-installer-*.tar.gz ${DIST_BASE}/gmg-backend/gmg-backend-installer-*.tar.gz .
+ echo ${DIST_BASE}/gmg/gmg-installer-$VERSION.tar.gz ${DIST_BASE}/gmg-backend/gmg-backend-installer-$VERSION.tar.gz
}
-main "$@";
-
+main "$@"