[PATCH lkp-tests] tests/build-pkg: fix to generate the directory of *.cgz file

[why] Since the file upload path saved by ES is inconsistent with the file path generated by the build-pkg script, the *.cgz file upload failed. [error] ==> /tmp/stdout <== renamed '/initrd/build-pkg/nfs/openeuler/aarch64/20.03-SP1/kubelet/HEAD.cgz.tmp' -> '/initrd/build-pkg/nfs/openeuler/aarch64/20.03-SP1/kubelet/HEAD.cgz' ==> Leaving fakeroot environment. ==> Finished making: kubernetes 1.18.5-1 (Wed Dec 30 16:50:17 CST 2020) create soft link: latest.cgz -> HEAD.cgz ==> /tmp/stderr <== curl: (22) The requested URL returned error: 403 Forbidden Signed-off-by: Liu Shaofei <370072077@qq.com> --- tests/build-pkg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/build-pkg b/tests/build-pkg index 801649cf4..e21397ee6 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -88,6 +88,9 @@ request_pkg() create_cgz_name() { + pkgname="${pkgname}" + [ -n "${pkgbase}" ] && pkgname="${pkgbase}" + cgz_path="$PKG_MNT/${pack_to}/${pkgname}" cgz_name="${cgz_path}/${upstream_commit}.cgz" pkg_args="-A --check --skippgpcheck" -- 2.23.0

On Wed, Dec 30, 2020 at 10:07:30PM +0800, Liu Shaofei wrote:
[why] Since the file upload path saved by ES is inconsistent with the file path generated by the build-pkg script, the *.cgz file upload failed.
[error] ==> /tmp/stdout <== renamed '/initrd/build-pkg/nfs/openeuler/aarch64/20.03-SP1/kubelet/HEAD.cgz.tmp' -> '/initrd/build-pkg/nfs/openeuler/aarch64/20.03-SP1/kubelet/HEAD.cgz' ==> Leaving fakeroot environment. ==> Finished making: kubernetes 1.18.5-1 (Wed Dec 30 16:50:17 CST 2020) create soft link: latest.cgz -> HEAD.cgz
==> /tmp/stderr <== curl: (22) The requested URL returned error: 403 Forbidden
Signed-off-by: Liu Shaofei <370072077@qq.com> --- tests/build-pkg | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/tests/build-pkg b/tests/build-pkg index 801649cf4..e21397ee6 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -88,6 +88,9 @@ request_pkg()
create_cgz_name() { + pkgname="${pkgname}"
This line looks redundant. Thanks, Xijian
+ [ -n "${pkgbase}" ] && pkgname="${pkgbase}" + cgz_path="$PKG_MNT/${pack_to}/${pkgname}" cgz_name="${cgz_path}/${upstream_commit}.cgz" pkg_args="-A --check --skippgpcheck" -- 2.23.0

On Thu, Dec 31, 2020 at 09:26:21AM +0800, Xu Xijian wrote:
On Wed, Dec 30, 2020 at 10:07:30PM +0800, Liu Shaofei wrote:
[why] Since the file upload path saved by ES is inconsistent with the file path generated by the build-pkg script, the *.cgz file upload failed.
[error] ==> /tmp/stdout <== renamed '/initrd/build-pkg/nfs/openeuler/aarch64/20.03-SP1/kubelet/HEAD.cgz.tmp' -> '/initrd/build-pkg/nfs/openeuler/aarch64/20.03-SP1/kubelet/HEAD.cgz' ==> Leaving fakeroot environment. ==> Finished making: kubernetes 1.18.5-1 (Wed Dec 30 16:50:17 CST 2020) create soft link: latest.cgz -> HEAD.cgz
==> /tmp/stderr <== curl: (22) The requested URL returned error: 403 Forbidden
Signed-off-by: Liu Shaofei <370072077@qq.com> --- tests/build-pkg | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/tests/build-pkg b/tests/build-pkg index 801649cf4..e21397ee6 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -88,6 +88,9 @@ request_pkg()
create_cgz_name() { + pkgname="${pkgname}"
This line looks redundant.
Enn..., you are right. ok Thanks, Liushaofei
Thanks, Xijian
+ [ -n "${pkgbase}" ] && pkgname="${pkgbase}" + cgz_path="$PKG_MNT/${pack_to}/${pkgname}" cgz_name="${cgz_path}/${upstream_commit}.cgz" pkg_args="-A --check --skippgpcheck" -- 2.23.0

create_cgz_name() {
+ pkgname="${pkgname}" + [ -n "${pkgbase}" ] && pkgname="${pkgbase}"
if you donot want modify the global ${pkgname}, you can use `local` to implement, just like this: local pkgname="${pkgname}" -------- Thanks Yu Chuan
+ cgz_path="$PKG_MNT/${pack_to}/${pkgname}" cgz_name="${cgz_path}/${upstream_commit}.cgz" pkg_args="-A --check --skippgpcheck" -- 2.23.0

On Thu, Dec 31, 2020 at 02:16:20PM +0800, Yu Chuan wrote:
create_cgz_name() {
+ pkgname="${pkgname}" + [ -n "${pkgbase}" ] && pkgname="${pkgbase}"
if you donot want modify the global ${pkgname}, you can use `local` to implement, just like this: local pkgname="${pkgname}"
ok, However, other location is still to use 'pkgname', it should be global, not be local. Thanks, Liushaofei
-------- Thanks Yu Chuan
+ cgz_path="$PKG_MNT/${pack_to}/${pkgname}" cgz_name="${cgz_path}/${upstream_commit}.cgz" pkg_args="-A --check --skippgpcheck" -- 2.23.0

On Thu, Dec 31, 2020 at 02:22:13PM +0800, Liu Shaofei wrote:
On Thu, Dec 31, 2020 at 02:16:20PM +0800, Yu Chuan wrote:
create_cgz_name() {
+ pkgname="${pkgname}" + [ -n "${pkgbase}" ] && pkgname="${pkgbase}"
if you donot want modify the global ${pkgname}, you can use `local` to implement, just like this: local pkgname="${pkgname}"
ok, However, other location is still to use 'pkgname', it should be global, not be local.
So, how about use uppercase for global var? -------- Thanks Yu Chuan
Thanks, Liushaofei
-------- Thanks Yu Chuan
+ cgz_path="$PKG_MNT/${pack_to}/${pkgname}" cgz_name="${cgz_path}/${upstream_commit}.cgz" pkg_args="-A --check --skippgpcheck" -- 2.23.0
participants (3)
-
Liu Shaofei
-
Xu Xijian
-
Yu Chuan