diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/libs/lib-blockdevices-filesystems.sh | 6 | ||||
-rw-r--r-- | src/core/libs/lib-misc.sh | 10 | ||||
-rw-r--r-- | src/core/procedures/automatic | 4 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 1307d52..4979c1f 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -395,7 +395,7 @@ process_filesystems () fs_id="$part $fs_type $fs_mountpoint $fs_opts $fs_label $fs_params" if [ "$fs_create" = yes ] then - if check_is_in "${done_filesystems[@]}" "$fs_id" + if check_is_in "$fs_id" "${done_filesystems[@]}" then debug 'FS' "$fs_id ->Already done" else @@ -472,7 +472,7 @@ rollback_filesystems () elif [ "$fs_mountpoint" != no_mountpoint ] then part_real=${part/+/} - if ! check_is_in "${done_umounts[@]}" "$part_real" + if ! check_is_in "$part_real" "${done_umounts[@]}" then infofy "(Maybe) Umounting $part_real" disks if mount | grep -q "^$part_real " # could be that this was not mounted yet. no problem, we can just skip it then. @@ -744,7 +744,7 @@ get_blockdevice_size () [ -b "$1" ] || die_error "get_blockdevice_size needs a blockdevice as \$1 ($1 given)" unit=${2:-B} allowed_units=(B KiB kB MiB MB GiB GB) - if ! check_is_in "${allowed_units[@]}" $unit + if ! check_is_in $unit "${allowed_units[@]}" then die_error "Unrecognized unit $unit!" fi diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index 97252b9..6f7af95 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -46,18 +46,20 @@ wait_for () } -# $1 set (array) haystack -# $2 needle +# $1 needle +# $2 set (array) haystack check_is_in () { - [ -z "$1" ] && debug 'MISC' "check_is_in $1 $2" && die_error "check_is_in needs a non-empty needle as \$2 and a haystack as \$1!" # haystack can be empty though + [ -z "$1" ] && debug 'MISC' "check_is_in $1 $2" && die_error "check_is_in needs a non-empty needle as \$1 and a haystack as \$2!" # haystack can be empty though local pattern="$1" element shift for element do - [[ $element = $pattern ]] && return 0 + [[ $element = $pattern ]] && debug 'MISC' "Checking if $element = $pattern ..yes !" && return 0 + debug 'MISC' "Checking if $element = $pattern ... no" done + debug 'MISC' "Check_is_in could not find $1 in $2" return 1 } diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic index 3c93167..cde7f6a 100644 --- a/src/core/procedures/automatic +++ b/src/core/procedures/automatic @@ -71,14 +71,14 @@ worker_runtime_network () # Check if we have all needed settings loaded from the profile worker_runtime_settings () { - if check_is_in $var_RUNTIME_PACKAGES svn + if check_is_in svn $var_RUNTIME_PACKAGES then [ -z "$SVN_USERNAME" ] && ask_string "Please enter your svn username" && SVN_USERNAME=$ANSWER_STRING [ -z "$SVN_PASSWORD" ] && ask_password svn #TODO: if user entered incorrect password, the install process will just fail.. [ -z "$SVN_BASE" ] && ask_string "What's the base path of your svn repo? (no ending /) " && SVN_BASE=$ANSWER_STRING [ -z "$DEPLOY_CLASS" ] && ask_string "Which hostclass are you installing? (optional)" '' 0 && DEPLOY_CLASS=$ANSWER_STRING SVN="svn --username $SVN_USERNAME --password $SVN_PASSWORD" - elif check_is_in $var_RUNTIME_PACKAGES moo + elif check_is_in moo $var_RUNTIME_PACKAGES then # Maybe more stuff later true |