Commit 4d804c251f59776eb0668317b8e5cda5937416a9
1 parent
63ffbef1
Adjusted script to check closed_source if repo does not exist in open_source
Showing
1 changed file
with
12 additions
and
2 deletions
scripts/setup_submodules
@@ -4,6 +4,10 @@ | @@ -4,6 +4,10 @@ | ||
4 | # == Setting some environment variables | 4 | # == Setting some environment variables |
5 | # =============================================== | 5 | # =============================================== |
6 | GIT_URL_SUBS="http://gitlab.osdev.nl/open_source" | 6 | GIT_URL_SUBS="http://gitlab.osdev.nl/open_source" |
7 | +GIT_URL_SUBS_CLOSED="http://gitlab.osdev.nl/closed_source" | ||
8 | + | ||
9 | +OPEN_REPOS=("mqtt-cpp" "transqueue" "orm" "network" "jobscheduler" "global" "dbconnector" "logutils" "pugixml" "qt-mqtt" "iputils" "crypter" "qt-bluetooth" "versioning" "cmake") | ||
10 | + | ||
7 | FUNC_RESULT="-1" | 11 | FUNC_RESULT="-1" |
8 | 12 | ||
9 | # Name : print_usage_exit() | 13 | # Name : print_usage_exit() |
@@ -101,8 +105,14 @@ function add_submodules() | @@ -101,8 +105,14 @@ function add_submodules() | ||
101 | for SUB_MODULE in ${SUB_MODULES} | 105 | for SUB_MODULE in ${SUB_MODULES} |
102 | do | 106 | do |
103 | echo -e "< ${SUB_MODULE} >" | 107 | echo -e "< ${SUB_MODULE} >" |
104 | - git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git ${SUB_MODULE} | ||
105 | - git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git | 108 | + if [[ "${OPEN_REPOS[*]}" =~ "${SUB_MODULE}" ]]; |
109 | + then | ||
110 | + git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git ${SUB_MODULE} | ||
111 | + git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git | ||
112 | + else | ||
113 | + git submodule add -f ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git ${SUB_MODULE} | ||
114 | + git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS_CLOSED}/${SUB_MODULE}.git | ||
115 | + fi | ||
106 | done | 116 | done |
107 | } | 117 | } |
108 | 118 |