[why] Some repository have submodules. So when build packages, we need download submodules from LKP server, avoid the waste of time in downloading files from the remote end.
Signed-off-by: Liu Shaofei liushaofei5@huawei.com --- sbin/makepkg | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/sbin/makepkg b/sbin/makepkg index 25773621..050f4fac 100755 --- a/sbin/makepkg +++ b/sbin/makepkg @@ -623,6 +623,15 @@ extract_git() {
cd_safe "${dir##*/}"
+ # modify submodules address to local server address. + # upstream_repo is externlly imported variable, like this: + # upstream_repo="c/czmq/czmq.git" + if [[ -f ".gitmodules" ]]; then + local project=${upstream_repo%/*} + local url="git://${LKP_SERVER}/submodules/${project}/" + sed -i "s|url = .*/|${url}|g" ".gitmodules" + fi + local ref=origin/HEAD if [[ -n $fragment ]]; then case ${fragment%%=*} in