
On Mon, Nov 16, 2020 at 10:52:09AM +0800, Liu Shaofei wrote:
Some repositories 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 | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/sbin/makepkg b/sbin/makepkg index fde82212..6f8b95af 100755 --- a/sbin/makepkg +++ b/sbin/makepkg @@ -623,6 +623,11 @@ 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
We can simplify like this: [ -f ".gitmodules" -a -n ${LKP_SERVER} ] && { echo -e "[url \"git://${LKP_SERVER}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig } Thanks, Xijian