[why] When building software package by cci-makepkg, the source codes repository contains submodules. By default, these submodules are downloaded from the local server, but the local server does not have submodules download address. So the submodules repository fails to be downloaded to test machine during the build.
Signed-off-by: Liu Shaofei 370072077@qq.com --- sbin/makepkg | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/sbin/makepkg b/sbin/makepkg index 7a92ea71b..b592a2ccb 100755 --- a/sbin/makepkg +++ b/sbin/makepkg @@ -587,6 +587,17 @@ download_git() { fi }
+# modify submodules address to local server address. +# [ "$DISABLE_DOMAIN_CHANGE" == "false" ] => replace submodules domain, and download it from local server +# [ "$DISABLE_DOMAIN_CHANGE" == "true" ] => not replace submodules domain, and download it from remote end. +modify_gitmodules() { + [ "$DISABLE_DOMAIN_CHANGE" == "false" ] || return + + if [[ -f ".gitmodules" ]] && [[ -n ${LKP_SERVER} ]]; then + echo -e "[url "git://${LKP_SERVER}/"]\n\tinsteadOf = https://" >> /etc/gitconfig + fi +} + extract_git() { local netfile=$1
@@ -623,10 +634,7 @@ extract_git() {
cd_safe "${dir##*/}"
- # modify submodules address to local server address. - if [[ -f ".gitmodules" ]] && [[ -n ${LKP_SERVER} ]]; then - echo -e "[url "git://${LKP_SERVER}/"]\n\tinsteadOf = https://" >> /etc/gitconfig - fi + modify_gitmodules
local ref=origin/HEAD if [[ -n $fragment ]]; then @@ -3668,6 +3676,7 @@ SRCEXT=${_SRCEXT:-$SRCEXT} GPGKEY=${_GPGKEY:-$GPGKEY} PACKAGER=${_PACKAGER:-$PACKAGER} CARCH=${_CARCH:-$CARCH} +DISABLE_DOMAIN_CHANGE=${DISABLE_DOMAIN_CHANGE:-false}
if (( INFAKEROOT )); then if [[ -z $FAKEROOTKEY ]]; then