1. modify *.cgz file save path /srv/initrd/build-pkg/nasm-git => /srv/initrd/build-pkg/initramfs/openeuler/aarch64/20.03/nasm-git
2. create softlink name that named by tag
../nasm-git/f71820d6055373c9b9381615e28a28f307bb2df4.CGZ ../nasm-git/1.0.4.cgz -> f71820d6055373c9b9381615e28a28f307bb2df4.cgz
Signed-off-by: Liu Shaofei liushaofei5@huawei.com --- tests/build-pkg | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/tests/build-pkg b/tests/build-pkg index b10b1497..65cb6dc7 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -2,10 +2,12 @@ # - os # - os_arch # - os_version +# - os_mount # - pkgbuild_repo # - upstream_repo # - upstream_url # - upstream_commit +# - upstream_tag
## makepkg is a script that automates the building of packages; it can download and validate source files, ## check dependencies, configure build-time settings, compile the sources, install into a temporary root, @@ -21,10 +23,14 @@ check_vars() [ -n "$os_version" ] || die "os_version is empty" [ -n "$pkgbuild_repo" ] || die "pkgbuild_repo is empty" [ -n "$upstream_commit" ] || die "upstream_commit is empty" + [ -n "$os_mount" ] || die "os_mount is empty" }
mount_dest() { + [[ "$os_mount" = "cifs" ]] && os_mount="nfs" + pack_to=${os_mount}/${os}/${os_arch}/${os_version} + PKG_MNT=/initrd/build-pkg mkdir -p "$PKG_MNT"
@@ -75,12 +81,22 @@ build_source_pkg() sed -i "s|^source=.*|${upstream_source}|g" PKGBUILD }
- cgz_name="$PKG_MNT/${pkgname}/${upstream_commit}.cgz" + 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 --config $LKP_SRC/etc/makepkg.conf 2>&1 }
+create_softlink() +{ + [ -n "$upstream_tag" ] || return + [ -e "$PKG_MNT/${pack_to}/${upstream_tag}.cgz" ] && return + + ln -sf "$(basename $(realpath ${cgz_name}))" "$PKG_MNT/${pack_to}/${pkgname}/${upstream_tag}.cgz" || return + echo "create soft link: $PKG_MNT/${pack_to}/${pkgname}/${upstream_tag}.cgz -> $(basename $(realpath ${cgz_name}))" +} + check_vars mount_dest request_pkg build_source_pkg +create_softlink
On Fri, Oct 16, 2020 at 04:00:33PM +0800, Liu Shaofei wrote:
- modify *.cgz file save path
/srv/initrd/build-pkg/nasm-git => /srv/initrd/build-pkg/initramfs/openeuler/aarch64/20.03/nasm-git
- create softlink name that named by tag
../nasm-git/f71820d6055373c9b9381615e28a28f307bb2df4.CGZ ../nasm-git/1.0.4.cgz -> f71820d6055373c9b9381615e28a28f307bb2df4.cgz
Signed-off-by: Liu Shaofei liushaofei5@huawei.com
tests/build-pkg | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/tests/build-pkg b/tests/build-pkg index b10b1497..65cb6dc7 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -2,10 +2,12 @@ # - os # - os_arch # - os_version +# - os_mount # - pkgbuild_repo # - upstream_repo # - upstream_url # - upstream_commit +# - upstream_tag
## makepkg is a script that automates the building of packages; it can download and validate source files, ## check dependencies, configure build-time settings, compile the sources, install into a temporary root, @@ -21,10 +23,14 @@ check_vars() [ -n "$os_version" ] || die "os_version is empty" [ -n "$pkgbuild_repo" ] || die "pkgbuild_repo is empty" [ -n "$upstream_commit" ] || die "upstream_commit is empty"
- [ -n "$os_mount" ] || die "os_mount is empty"
}
mount_dest() {
- [[ "$os_mount" = "cifs" ]] && os_mount="nfs"
- pack_to=${os_mount}/${os}/${os_arch}/${os_version}
- PKG_MNT=/initrd/build-pkg mkdir -p "$PKG_MNT"
@@ -75,12 +81,22 @@ build_source_pkg() sed -i "s|^source=.*|${upstream_source}|g" PKGBUILD }
- cgz_name="$PKG_MNT/${pkgname}/${upstream_commit}.cgz"
- 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 --config $LKP_SRC/etc/makepkg.conf 2>&1
}
+create_softlink() +{
- [ -n "$upstream_tag" ] || return
return 0
btw, better auto detect upstream_tag instead of requiring others to pass it in.
- [ -e "$PKG_MNT/${pack_to}/${upstream_tag}.cgz" ] && return
- ln -sf "$(basename $(realpath ${cgz_name}))" "$PKG_MNT/${pack_to}/${pkgname}/${upstream_tag}.cgz" || return
Just link to $upstream_commit.cgz No realpath etc.
Thanks, Fengguang
- echo "create soft link: $PKG_MNT/${pack_to}/${pkgname}/${upstream_tag}.cgz -> $(basename $(realpath ${cgz_name}))"
+}
check_vars mount_dest request_pkg build_source_pkg
+create_softlink
2.23.0