diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-11-06 14:05:39 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-11-06 14:36:06 +0100 |
commit | 9201b13dcddb0903624a029e05ce32fb309c8f83 (patch) | |
tree | 12e6cd14933a5ed93e126ddbd3834cad8bebedef /export-validation | |
parent | a0c61cfafa575aebb2569cba172afa7ca0dc2665 (diff) |
Add check if subversion is in PATH
+ reduce some code duplication
Diffstat (limited to 'export-validation')
-rwxr-xr-x | export-validation/setup.sh | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/export-validation/setup.sh b/export-validation/setup.sh index 33921a1b..69f31cb4 100755 --- a/export-validation/setup.sh +++ b/export-validation/setup.sh @@ -9,6 +9,18 @@ # Run this script to download, build and install the validators. +print_SUSE_errormsg() +{ + package=$1 + + if [ -e /etc/os-release ]; then + . /etc/os-release + if [ "$NAME" == "openSUSE" ]; then + echo "Hint: type 'zypper in $1' to install it." + fi + fi +} + if [ -z "$1" -o -z "$2" ]; then echo "Usage: $0 <workdir> <instdir>" echo @@ -30,13 +42,13 @@ fi if ! type -p ant >/dev/null; then echo "Error: can't find ant in PATH" + print_SUSE_errormsg 'ant' + exit 1 +fi - if [ -e /etc/os-release ]; then - . /etc/os-release - if [ "$NAME" == "openSUSE" ]; then - echo "Hint: type 'zypper in ant-junit' to install it." - fi - fi +if ! type -p svn >/dev/null; then + echo "Error: can't find svn in PATH" + print_SUSE_errormsg 'subversion' exit 1 fi |