From e05b83300d026fb11b437cfa6845a8fb8fd1bf1b Mon Sep 17 00:00:00 2001 From: Steven de Ridder Date: Wed, 26 Jan 2022 08:49:52 +0100 Subject: [PATCH] Adjusted script to check closed_source if repo does not exist in open_source --- scripts/setup_submodules | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/setup_submodules b/scripts/setup_submodules index b8c7a6e..720322b 100755 --- a/scripts/setup_submodules +++ b/scripts/setup_submodules @@ -4,6 +4,10 @@ # == Setting some environment variables # =============================================== GIT_URL_SUBS="http://gitlab.osdev.nl/open_source" +GIT_URL_SUBS_CLOSED="http://gitlab.osdev.nl/closed_source" + +OPEN_REPOS=("mqtt-cpp" "transqueue" "orm" "network" "jobscheduler" "global" "dbconnector" "logutils" "pugixml" "qt-mqtt" "iputils" "crypter" "qt-bluetooth" "versioning" "cmake") + FUNC_RESULT="-1" # Name : print_usage_exit() @@ -101,8 +105,16 @@ function add_submodules() for SUB_MODULE in ${SUB_MODULES} do echo -e "< ${SUB_MODULE} >" - git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git ${SUB_MODULE} - git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git + if [[ "${OPEN_REPOS[*]}" =~ "${SUB_MODULE}" ]]; + then + echo "open_source repo" + git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git ${SUB_MODULE} + git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git + else + echo "closed_source repo" + git submodule add -f ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git ${SUB_MODULE} + git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git + fi done } -- libgit2 0.21.4