From 88ec05cba205c4e77d5b8565698118c1fc04a760 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Wed, 6 Mar 2019 19:37:34 +0800 Subject: [PATCH] ci: Fix the parsing of submodule paths --- .gitlab-ci.yml | 2 +- tools/ci/mirror-submodule-update.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08156cfe8..8742f5fd7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ variables: GET_SOURCES_ATTEMPTS: "10" ARTIFACT_DOWNLOAD_ATTEMPTS: "10" - # We use get_sources.sh script to fetch the submodules and/or re-fetch the repo + # We use get-full-sources.sh script to fetch the submodules and/or re-fetch the repo # if it was corrupted (if submodule update fails this can happen) GIT_STRATEGY: fetch GIT_SUBMODULE_STRATEGY: none diff --git a/tools/ci/mirror-submodule-update.sh b/tools/ci/mirror-submodule-update.sh index 068838a77..3a15dbe99 100755 --- a/tools/ci/mirror-submodule-update.sh +++ b/tools/ci/mirror-submodule-update.sh @@ -54,13 +54,15 @@ git submodule init # 2 # Replacing each submodule URL of the current repository # according to the one found in the MIRRORLIST - -# SED parses the strings like: # -#-b991c67c1d91574ef22336cc3a5944d1e63230c9 roms/ipxe -#b991c67c1d91574ef22336cc3a5944d1e63230c9 roms/ipxe (v1.0.0-2388-gb991c67) -# -for SUBPATH in $(git submodule status | sed -E 's/.*[[:space:]](.*)([[:space:]].*|$)/\1/') +# Selecting paths among lines: +# ... +#submodule.components/esp32/lib.path +#submodule.components/esp32/lib.url +#submodule.components/esptool_py/esptool.path +#submodule.components/esptool_py/esptool.url +#... +for SUBPATH in $(git config -f .gitmodules --list --name-only | grep "\.path" | sed 's/^submodule\.\([^ ]*\)\.path$/\1/') do SUBMIRROR=$(join -o"2.2" <(echo ${SUBPATH}) <(sort ${MIRRORLIST})) [ ${SUBMIRROR} ] || continue