diff options
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 |