[PATCH v2 lkp-tests] tests/build-pkg: support squid download remote files

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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/build-pkg b/tests/build-pkg index e4eca747..2729070a 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -108,6 +108,8 @@ replace_source() echo "$url" | egrep 'git\+|\.git$' && { 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 +128,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

On Tue, Dec 08, 2020 at 08:43:44PM +0800, Liu Shaofei wrote:
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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/build-pkg b/tests/build-pkg index e4eca747..2729070a 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -108,6 +108,8 @@ replace_source() echo "$url" | egrep 'git\+|\.git$' && { url="\"${repo_dir}git://${LKP_SERVER}/${upstream_repo}#commit=${upstream_commit}\"" } + url=$(echo "$url" | sed 's|https:\/\/|http:\/\/|g')
^ this $ will give a error info Thanks, Xueliang
+ echo "$url" >> $1 done echo ")" >> $1 @@ -126,8 +128,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

} + url=$(echo "$url" | sed 's|https:\/\/|http:\/\/|g')
^ this $ will give a error info
It's a command in $(), why error? Thanks, Zhangyu
+ echo "$url" >> $1 done echo ")" >> $1 @@ -126,8 +128,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
participants (3)
-
Cao Xueliang
-
Liu Shaofei
-
Zhang Yu