diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-02-19 23:15:36 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-05-28 14:46:58 +0900 |
commit | 38aaa2667f7c4e41fb399ac265456491068f60a7 (patch) | |
tree | 580bddea0aac000029ec85dddb71e940ee7d0ae8 /debian/_buildscripts/local/scripts/_build_common.sh | |
parent | 80b6864a4cd886534f4158130e3c4ef450943ade (diff) | |
download | tde-packaging-38aaa2667f7c4e41fb399ac265456491068f60a7.tar.gz tde-packaging-38aaa2667f7c4e41fb399ac265456491068f60a7.zip |
DEB build scripts: fixed version numbering scheme. Added check to make
sure the selected distro and version is supported.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/_buildscripts/local/scripts/_build_common.sh')
-rwxr-xr-x | debian/_buildscripts/local/scripts/_build_common.sh | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/debian/_buildscripts/local/scripts/_build_common.sh b/debian/_buildscripts/local/scripts/_build_common.sh index 60f589acf..1287f8e12 100755 --- a/debian/_buildscripts/local/scripts/_build_common.sh +++ b/debian/_buildscripts/local/scripts/_build_common.sh @@ -89,7 +89,37 @@ function init_common() echo "Please check and modify the TDE_DIR variable as required, then rerun this script." exit 5 fi - + + # Make sure we have selected a supported distribution + DISTS_FILE=$SCRIPT_DIR/distro_list.txt + if [ ! -f "$DISTS_FILE" ]; then + echo -e "${CYellow} --- NOTE ---${CNone}" + echo "Could not find the list of supported distributions." + echo "Please check the file $DISTS_FILE exists, then rerun this script." + exit 6 + fi + export DISTRO_FOUND=${DISTRO_FOUND:-"n"} + if [ "$DISTRO_FOUND" != "y" ]; then + # Need to use a "here string" otherwise if the DISTRO_FOUND value is modified + # inside the while loop, this would not remember after the loop. + while read l_distro l_version l_name l_rel_suffix; do + if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then + export DISTRO_FOUND="y" + export DISTRO_VERSION="$l_version" + export REL_SUFFIX="$l_rel_suffix" + break + fi + done <<< $(cat $DISTS_FILE | grep -E "^(\s*[^#\s]+\s+[^\s]+.*)$") + fi + if [ "$DISTRO_FOUND" != "y" ]; then + echo -e "${CYellow} --- NOTE ---${CNone}" + echo "The specified distribution ($DISTRO $DISTRO_NAME) is not supported." + echo "Something is wrong with your configuration ($CFG_FILE)" + echo "or with the list of supported distributions ($DISTS_FILE)." + echo "Please check the DISTRO and DISTRO_NAME variables, then rerun this script." + exit 7 + fi + SCRIPT_LOG_DIR=$TDE_DIR/$CFG_SCRIPT_LOG_DIR LOG_RESULT_FILENAME="$SCRIPT_LOG_DIR/build_result.log" # Log result into the common build logfile |