From 8bb36a4b48211ab3115590bd2860f230e8257fd1 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 23 May 2021 16:09:48 +0900 Subject: [PATCH] DEB build scripts: added ability to build local modules even when they are not yet part of the TDE umbrella. Signed-off-by: Michele Calgaro --- debian/_buildscripts/local/build_module.sh | 42 +++++++++++++--------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/debian/_buildscripts/local/build_module.sh b/debian/_buildscripts/local/build_module.sh index 850651e42..280d5fb22 100755 --- a/debian/_buildscripts/local/build_module.sh +++ b/debian/_buildscripts/local/build_module.sh @@ -78,27 +78,37 @@ function search_module() MOD_GIT_PKGING_PATH="$REPO_TDE_PACKAGING/$MOD_NAME/debian" MOD_BUILD_PATH="$TDE_BUILD_DIR/$MOD_NAME" else - # Search in extra dependency folder - LOC_BASENAME=`echo "$LOC_MOD_NAME" | sed -r "s|^${CFG_EXTRA_DEPS_DIR}/(debian/)?||"` - LOC_MATCH=`ls "$REPO_EXTRA_DEPENDENCIES/debian" | grep "^$LOC_BASENAME\$"` - if [ "$LOC_MATCH" != "" -a "`echo $LOC_MATCH | wc -l`" = "1" ]; then - # Unique module found + # Search for a unique folder with the same name + if [ -d "${REPO_TDE_MAIN}/$LOC_MOD_NAME" ]; then + # Folder found MODULE_FOUND="y" - bool_EXTRADEP_MOD="y" - MOD_NAME="$CFG_EXTRA_DEPS_DIR/$LOC_MATCH" - MOD_GIT_PATH="$REPO_EXTRA_DEPENDENCIES/debian/$LOC_BASENAME" - MOD_BUILD_PATH="$TDE_BUILD_DIR/$CFG_EXTRA_DEPS_DIR/$LOC_BASENAME" + MOD_NAME=$LOC_MOD_NAME + MOD_GIT_PATH="$REPO_TDE_MAIN/$MOD_NAME" + MOD_GIT_PKGING_PATH="$REPO_TDE_PACKAGING/$MOD_NAME/debian" + MOD_BUILD_PATH="$TDE_BUILD_DIR/$MOD_NAME" else - # Search in metapackages folder - LOC_BASENAME=`echo "$LOC_MOD_NAME" | sed -r "s|^(metapackages/)?||"` - LOC_MATCH=`ls "$REPO_TDE_MAIN/metapackages" | grep "^$LOC_BASENAME\$"` + # Search in extra dependency folder + LOC_BASENAME=`echo "$LOC_MOD_NAME" | sed -r "s|^${CFG_EXTRA_DEPS_DIR}/(debian/)?||"` + LOC_MATCH=`ls "$REPO_EXTRA_DEPENDENCIES/debian" | grep "^$LOC_BASENAME\$"` if [ "$LOC_MATCH" != "" -a "`echo $LOC_MATCH | wc -l`" = "1" ]; then # Unique module found MODULE_FOUND="y" - MOD_NAME="metapackages/$LOC_MATCH" - MOD_GIT_PATH="$REPO_TDE_MAIN/metapackages/$LOC_BASENAME" - MOD_GIT_PKGING_PATH="$REPO_TDE_PACKAGING/$MOD_NAME/debian" - MOD_BUILD_PATH="$TDE_BUILD_DIR/metapackages/$LOC_BASENAME" + bool_EXTRADEP_MOD="y" + MOD_NAME="$CFG_EXTRA_DEPS_DIR/$LOC_MATCH" + MOD_GIT_PATH="$REPO_EXTRA_DEPENDENCIES/debian/$LOC_BASENAME" + MOD_BUILD_PATH="$TDE_BUILD_DIR/$CFG_EXTRA_DEPS_DIR/$LOC_BASENAME" + else + # Search in metapackages folder + LOC_BASENAME=`echo "$LOC_MOD_NAME" | sed -r "s|^(metapackages/)?||"` + LOC_MATCH=`ls "$REPO_TDE_MAIN/metapackages" | grep "^$LOC_BASENAME\$"` + if [ "$LOC_MATCH" != "" -a "`echo $LOC_MATCH | wc -l`" = "1" ]; then + # Unique module found + MODULE_FOUND="y" + MOD_NAME="metapackages/$LOC_MATCH" + MOD_GIT_PATH="$REPO_TDE_MAIN/metapackages/$LOC_BASENAME" + MOD_GIT_PKGING_PATH="$REPO_TDE_PACKAGING/$MOD_NAME/debian" + MOD_BUILD_PATH="$TDE_BUILD_DIR/metapackages/$LOC_BASENAME" + fi fi fi fi