
When building software in PKGBUILD file, download upstream files often times out. We need to cache these files by squid server.The example is as follow: https://invisible-mirror.net/archives/conflict/conflict-20150705.tgz => http://invisible-mirror.net/archives/conflict/conflict-20150705.tgz Signed-off-by: Liu Shaofei <liushaofei5@huawei.com> --- tests/build-pkg | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/build-pkg b/tests/build-pkg index e4eca747..c1b0513e 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -106,8 +106,12 @@ replace_source() for url in ${source[@]} do echo "$url" | egrep 'git\+|\.git$' && { - url="\"${repo_dir}git://${LKP_SERVER}/${upstream_repo}#commit=${upstream_commit}\"" + [ -n "$repo_dir" ] && { + url="\"${repo_dir}git://${LKP_SERVER}/${upstream_repo}#commit=${upstream_commit}\"" + } } + url=$(echo "$url" | sed 's|https:\/\/|http:\/\/|g') + echo "$url" >> $1 done echo ")" >> $1 @@ -126,8 +130,7 @@ build_source_pkg() repo_dir="${repo_dir%.git*}::" fi } - - replace_source "PKGBUILD.src" + replace_source PKGBUILD.src [ -n "$PKGBUILD_TAG" ] && replace_source "PKGBUILD-$PKGBUILD_TAG" -- 2.23.0