On Wed, Dec 02, 2020 at 03:12:00PM +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 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/tests/build-pkg b/tests/build-pkg index bdaef035..cde2f0ed 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -98,6 +98,26 @@ 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' && {
local_url="http://${LKP_SERVER}:8800/initrd/build-tar/${pkgname}/${url##*/}"
# check whether local server exists *.tar.* file
wget -q --spider "${local_url}"
[ "$?" == 0 ] || continue
maybe ==> wget -q --spider "${local_url}" || continue Thanks, Ping
url="\"${local_url}\""
- }
- echo "$url" >> PKGBUILD.src
- done
- echo ")" >> PKGBUILD.src
+}
build_source_pkg() { local repo_dir="" @@ -116,6 +136,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
-- 2.23.0