refactor(tfut): move config_valid() to utils.sh

config_valid() function had to be moved from build_package.sh to
utils.sh so it can be used in multiple scripts.

Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Signed-off-by: Edward Potapov <edward.potapov@arm.com>
Change-Id: Ie9fe32eabba047fe8e1e718e06494909d2ac8246
diff --git a/script/build_package.sh b/script/build_package.sh
index d15071c..d0f96e4 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -61,16 +61,6 @@
 # File to save any environem
 hook_env_file="$(mktempfile)"
 
-# Check if a config is valid
-config_valid() {
-	local config="${1?}"
-	if [ -z "$config" ] || [ "$(basename "$config")" = "nil" ]; then
-		return 1
-	fi
-
-	return 0
-}
-
 # Echo from a build wrapper. Print to descriptor 3 that's opened by the build
 # function.
 echo_w() {
diff --git a/utils.sh b/utils.sh
index 8811939..c4af89f 100644
--- a/utils.sh
+++ b/utils.sh
@@ -560,6 +560,16 @@
     echo "${cross_compile_path}/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-"
 }
 
+# Check if a config is valid
+config_valid() {
+	local config="${1?}"
+	if [ -z "$config" ] || [ "$(basename "$config")" = "nil" ]; then
+		return 1
+	fi
+
+	return 0
+}
+
 if is_jenkins_env; then
 	jenkins_run=1
 	umask 0002