use associative array and for loops to init submoduls

This commit is contained in:
lod 2023-11-26 15:41:48 +01:00
parent 10160b646a
commit 28f5bc15b4

View file

@ -53,29 +53,21 @@ prepare() {
patch ./tools/build-companion.sh < $srcdir/install.patch patch ./tools/build-companion.sh < $srcdir/install.patch
patch ./companion/src/CMakeLists.txt < $srcdir/remove-ssl-check.patch patch ./companion/src/CMakeLists.txt < $srcdir/remove-ssl-check.patch
cd $_pkgbase/companion/src/thirdparty/ declare -A submodules=(
git submodule init ["$_pkgbase/companion/src/thirdparty/"]="yaml-cpp"
git config submodule.yaml-cpp.url $srcdir/yaml-cpp ["$_pkgbase/radio/src/thirdparty/"]="AccessDenied FreeRTOS-Kernel libopenui"
git submodule update --init ["$_pkgbase/radio/src/thirdparty/FreeRTOS/portable/ThirdParty/"]="FreeRTOS-Kernel-Community-Supported-Ports FreeRTOS-Kernel-Partner-Supported-Ports"
["$_pkgbase/radio/src/thirdparty/libopenui/thirdparty/"]="lvgl stb"
cd $_pkgbase/radio/src/thirdparty/ )
git submodule init
git config submodule.AccessDenied.url $srcdir/AccessDenied for path in "${!submodules[@]}"; do
git config submodule.FreeRTOS-Kernel.url $srcdir/FreeRTOS cd $path
git config submodule.libopenui.url $srcdir/libopenui git submodule init
git submodule update --init for module in ${submodules[$path]}; do
git config submodule.$module.url $srcdir/$module
cd $_pkgbase/radio/src/thirdparty/FreeRTOS/portable/ThirdParty/ done
git submodule init git submodule update --init
git config submodule.FreeRTOS-Kernel-Community-Supported-Ports.url $srcdir/Community-Supported-Ports done
git config submodule.FreeRTOS-Kernel-Partner-Supported-Ports.url $srcdir/FreeRTOS-Kernel-Partner-Supported-Ports
git submodule update --init
cd $_pkgbase/radio/src/thirdparty/libopenui/thirdparty/
git submodule init
git config submodule.lvgl.url $srcdir/lvgl
git config submodule.stb.url $srcdir/stb
git submodule update --init
} }
build() { build() {