From 20ac9757ba69b78e17eb8895dfb32144a11ce740 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Mon, 7 May 2012 20:56:45 +0000 Subject: [PATCH] ci: wrap sanity checks --- scripts/ci/common.sh | 20 ++++++++++++-------- scripts/ci/debsrcbuilder.sh | 2 ++ scripts/ci/rpmbuilder.sh | 2 ++ scripts/ci/sounds-en-us-callie.sh | 2 ++ scripts/ci/src_tarball.sh | 2 ++ 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/scripts/ci/common.sh b/scripts/ci/common.sh index a570cd8008..5967ae8262 100755 --- a/scripts/ci/common.sh +++ b/scripts/ci/common.sh @@ -73,13 +73,17 @@ gnuize () { rm -rf .git } -if [ ! -d .git ]; then - echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2 - exit 1; -fi +check_pwd () { + if [ ! -d .git ]; then + echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2 + exit 1; + fi +} -if [ -z "$1" ]; then - echo "usage: $0 " 1>&2 - exit 1; -fi +check_input_ver_build () { + if [ -z "$1" ]; then + echo "usage: $0 " 1>&2 + exit 1; + fi +} diff --git a/scripts/ci/debsrcbuilder.sh b/scripts/ci/debsrcbuilder.sh index 3dc56e5faa..e5e429b153 100755 --- a/scripts/ci/debsrcbuilder.sh +++ b/scripts/ci/debsrcbuilder.sh @@ -5,6 +5,8 @@ sdir="." [ -n "${0%/*}" ] && sdir="${0%/*}" . $sdir/common.sh +check_pwd +check_input_ver_build eval $(parse_version "$1") datestamp="$(date +%Y%m%dT%H%M%SZ)" nightly="n${datestamp}" diff --git a/scripts/ci/rpmbuilder.sh b/scripts/ci/rpmbuilder.sh index 36b8b1d079..563bfca104 100755 --- a/scripts/ci/rpmbuilder.sh +++ b/scripts/ci/rpmbuilder.sh @@ -5,6 +5,8 @@ sdir="." [ -n "${0%/*}" ] && sdir="${0%/*}" . $sdir/common.sh +check_pwd +check_input_ver_build eval $(parse_version "$1") build="$2" diff --git a/scripts/ci/sounds-en-us-callie.sh b/scripts/ci/sounds-en-us-callie.sh index 39703028ca..6b3b0df0a6 100755 --- a/scripts/ci/sounds-en-us-callie.sh +++ b/scripts/ci/sounds-en-us-callie.sh @@ -5,6 +5,8 @@ sdir="." [ -n "${0%/*}" ] && sdir="${0%/*}" . $sdir/common.sh +check_pwd +check_input_ver_build eval $(parse_version "$1") build="$2" diff --git a/scripts/ci/src_tarball.sh b/scripts/ci/src_tarball.sh index 7fd48621e3..d4c3adffa7 100755 --- a/scripts/ci/src_tarball.sh +++ b/scripts/ci/src_tarball.sh @@ -5,6 +5,8 @@ sdir="." [ -n "${0%/*}" ] && sdir="${0%/*}" . $sdir/common.sh +check_pwd +check_input_ver_build eval $(parse_version "$1") dst_name="freeswitch-$cmajor.$cminor.$cmicro"