]> err.no Git - util-linux/commitdiff
tests: move some generic stuff from ts_init() to a new ts_init_env()
authorKarel Zak <kzak@redhat.com>
Tue, 20 Jan 2009 12:19:43 +0000 (13:19 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:32:58 +0000 (23:32 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/functions.sh

index f05944350615cdbe1beb03ee61187d3d9fc0d62d..fcde2ad4bca8dfa2a97c43541e1da3bd7f42c2bf 100644 (file)
@@ -63,8 +63,7 @@ function ts_has_option {
        echo -n $ALL | sed 's/ //g' | awk 'BEGIN { FS="="; RS="--" } /('$NAME'$|'$NAME'=)/ { print "yes" }'
 }
 
-function ts_init {
-       local is_fake=$( ts_has_option "fake" "$*")
+function ts_init_env {
        local mydir=$(ts_abspath $(dirname $0))
 
        export LANG="en_US.UTF-8"
@@ -109,8 +108,6 @@ function ts_init {
        rm -f $TS_OUTPUT
        touch $TS_OUTPUT
 
-       printf "%15s: %-30s ..." "$TS_COMPONENT" "$TS_DESC"
-
        if [ "$TS_VERBOSE" == "yes" ]; then
                echo
                echo "     script: $TS_SCRIPT"
@@ -127,6 +124,14 @@ function ts_init {
                echo " mountpoint: $TS_MOUNTPOINT"
                echo
        fi
+}
+
+function ts_init {
+       local is_fake=$( ts_has_option "fake" "$*")
+
+       ts_init_env "$*"
+
+       printf "%15s: %-30s ..." "$TS_COMPONENT" "$TS_DESC"
 
        [ "$is_fake" == "yes" ] && ts_skip "fake mode"
 }