From 29150ab5550ed7ba790720c08e73765db43ad1fb Mon Sep 17 00:00:00 2001 From: Steven de Ridder Date: Wed, 26 Jan 2022 09:32:55 +0100 Subject: [PATCH] Adjusted script to check closed_source if repo does not exist in open_source --- scripts/setup_submodules | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/setup_submodules b/scripts/setup_submodules index b8c7a6e..7b5e7d8 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,14 @@ 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 + 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 + 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