When the address of source field is the format of "*.tar.*", we need to replace it with local address. The following example:
source=("https://github.com/azukiapp/$%7Bpkgname%7D/archive/v$%7Bpkgver%7D.tar.gz") => source=("http://$%7BLKP_SERVER%7D:8800/initrd/build-tar/$%7Bpkgname%7D/v$%7Bpkgver%7D...")
Signed-off-by: Liu Shaofei liushaofei5@huawei.com --- tests/build-pkg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/tests/build-pkg b/tests/build-pkg index bdaef035..731ac409 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -98,6 +98,20 @@ replace_source() sed -i "s|^source=[^)]*|$1|g" "$2" }
+# replace *.tar.* address from source field in PKGBUILD +replace_tar_source() +{ + echo "source=(" > PKGBUILD.src + for url in ${source[@]} + do + echo "$url" | egrep '.+.tar..+|.+.tar' && { + url=""http://$%7BLKP_SERVER%7D:8800/initrd/build-tar/$%7Bpkgname%7D/$%7Burl##*/%7D..."" + } + echo "$url" >> PKGBUILD.src + done + echo ")" >> PKGBUILD.src +} + build_source_pkg() { local repo_dir="" @@ -116,6 +130,8 @@ build_source_pkg() [ -n "$PKGBUILD_TAG" ] && replace_source "${upstream_source}" "PKGBUILD-$PKGBUILD_TAG" }
+ replace_tar_source + cgz_name="$PKG_MNT/${pack_to}/${pkgname}/${upstream_commit}.cgz" PACMAN=true BUILDDIR=$TMP CARCH=$os_arch PKGEXT=.cgz CGZDEST="$cgz_name" \ $LKP_SRC/sbin/makepkg -A --check --skippgpcheck --config $LKP_SRC/etc/makepkg.conf 2>&1
On Mon, Nov 30, 2020 at 07:56:03PM +0800, Liu Shaofei wrote:
When the address of source field is the format of "*.tar.*", we need to replace it with local address. The following example:
source=("https://github.com/azukiapp/$%7Bpkgname%7D/archive/v$%7Bpkgver%7D.tar.gz") => source=("http://$%7BLKP_SERVER%7D:8800/initrd/build-tar/$%7Bpkgname%7D/v$%7Bpkgver%7D...")
Signed-off-by: Liu Shaofei liushaofei5@huawei.com
tests/build-pkg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/tests/build-pkg b/tests/build-pkg index bdaef035..731ac409 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -98,6 +98,20 @@ replace_source() sed -i "s|^source=[^)]*|$1|g" "$2" }
+# replace *.tar.* address from source field in PKGBUILD +replace_tar_source() +{
- echo "source=(" > PKGBUILD.src
- for url in ${source[@]}
- do
- echo "$url" | egrep '.+.tar..+|.+.tar' && {
url="\"http://${LKP_SERVER}:8800/initrd/build-tar/${pkgname}/${url##*/}\""
- }
- echo "$url" >> PKGBUILD.src
- done
- echo ")" >> PKGBUILD.src
+}
build_source_pkg() { local repo_dir="" @@ -116,6 +130,8 @@ build_source_pkg() [ -n "$PKGBUILD_TAG" ] && replace_source "${upstream_source}" "PKGBUILD-$PKGBUILD_TAG" }
- replace_tar_source
只要是tar包的,都会走缓存? 这样的话,如果缓存没有就会导致很多404错误 有两种方式可以避免 1.缓存所有的tar包 2.replace_tar_source 增加一个判断,提交job时可以选择是否走缓存 我更倾向于第2种方法 Thanks sunyukui
cgz_name="$PKG_MNT/${pack_to}/${pkgname}/${upstream_commit}.cgz" PACMAN=true BUILDDIR=$TMP CARCH=$os_arch PKGEXT=.cgz CGZDEST="$cgz_name" \ $LKP_SRC/sbin/makepkg -A --check --skippgpcheck --config $LKP_SRC/etc/makepkg.conf 2>&1 -- 2.23.0
On Tue, Dec 01, 2020 at 09:24:35AM +0800, Sun Yukui wrote:
On Mon, Nov 30, 2020 at 07:56:03PM +0800, Liu Shaofei wrote:
When the address of source field is the format of "*.tar.*", we need to replace it with local address. The following example:
source=("https://github.com/azukiapp/$%7Bpkgname%7D/archive/v$%7Bpkgver%7D.tar.gz") => source=("http://$%7BLKP_SERVER%7D:8800/initrd/build-tar/$%7Bpkgname%7D/v$%7Bpkgver%7D...")
Signed-off-by: Liu Shaofei liushaofei5@huawei.com
tests/build-pkg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/tests/build-pkg b/tests/build-pkg index bdaef035..731ac409 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -98,6 +98,20 @@ replace_source() sed -i "s|^source=[^)]*|$1|g" "$2" }
+# replace *.tar.* address from source field in PKGBUILD +replace_tar_source() +{
- echo "source=(" > PKGBUILD.src
- for url in ${source[@]}
- do
- echo "$url" | egrep '.+.tar..+|.+.tar' && {
url="\"http://${LKP_SERVER}:8800/initrd/build-tar/${pkgname}/${url##*/}\""
- }
- echo "$url" >> PKGBUILD.src
- done
- echo ")" >> PKGBUILD.src
+}
build_source_pkg() { local repo_dir="" @@ -116,6 +130,8 @@ build_source_pkg() [ -n "$PKGBUILD_TAG" ] && replace_source "${upstream_source}" "PKGBUILD-$PKGBUILD_TAG" }
- replace_tar_source
只要是tar包的,都会走缓存? 这样的话,如果缓存没有就会导致很多404错误 有两种方式可以避免 1.缓存所有的tar包 2.replace_tar_source 增加一个判断,提交job时可以选择是否走缓存 我更倾向于第
ok, but i think to have better funtion. Thanks, Liushaofei
Thanks sunyukui
cgz_name="$PKG_MNT/${pack_to}/${pkgname}/${upstream_commit}.cgz" PACMAN=true BUILDDIR=$TMP CARCH=$os_arch PKGEXT=.cgz CGZDEST="$cgz_name" \ $LKP_SRC/sbin/makepkg -A --check --skippgpcheck --config $LKP_SRC/etc/makepkg.conf 2>&1 -- 2.23.0