From ee0a5563b174cc5473b6bfc6128ce915fdc0af8e Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Wed, 11 Sep 2019 06:12:02 -0500 Subject: [PATCH] pkglib: Fix the detection of the versions.txt When we try to run the kata-deploy-binaries.sh script, we have a failure on the pkglib.sh script that we can not source the versions.txt. In order to avoid these kind of failures, we introduce to detect if this file exists and in case that it does not, we fail the script. Fixes #712 Signed-off-by: Gabriela Cervantes --- obs-packaging/scripts/pkglib.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/obs-packaging/scripts/pkglib.sh b/obs-packaging/scripts/pkglib.sh index ec6c7b60f..f889c4308 100644 --- a/obs-packaging/scripts/pkglib.sh +++ b/obs-packaging/scripts/pkglib.sh @@ -6,7 +6,14 @@ source_dir_pkg_lib=$(dirname "${BASH_SOURCE[0]}") source_dir_pkg_lib=$(realpath "${source_dir_pkg_lib}") source "${source_dir_pkg_lib}/../../scripts/lib.sh" -source "${source_dir_pkg_lib}/../versions.txt" + +# Verify that versions.txt exists +version_file="${source_dir_pkg_lib}/../versions.txt" +if [ -f "${version_file}" ]; then + source "${version_file}" +else + die "${version_file} does not exist, you need to run first the gen_versions_txt.sh" +fi PACKAGING_DIR=/var/packaging LOG_DIR=${PACKAGING_DIR}/build_logs