[before] $ ll $LKP_SRC/distro/depends/sysbench-cpu sysbench-cpu -> sysbench $ tree /srv/initrd/deps/$os/$os_arch/$os_version/ . ├── sysbench_20200903.cgz ├── sysbench.cgz -> sysbench_20200903.cgz └── sysbench-cpu.cgz -> sysbench.cgz
all cgz file under one directory, so we can generate symlink when depends file is a symlink
[after] $ tree /srv/initrd/deps/$os/$os_arch/$os_version/sysbench-cpu . ├── sysbench-cpu_20210128.cgz └── sysbench-cpu.cgz -> sysbench-cpu_20210128.cgz
now we upload cgz file through curl, it's not appropriate to generate symlink directly, now generate original cgz file and rename it
Signed-off-by: Wang Yong wangyong0117@qq.com --- distro/common | 13 +++++++++++++ tests/cci-depends | 9 ++------- 2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/distro/common b/distro/common index 1fd7df4e8..da2a57a79 100755 --- a/distro/common +++ b/distro/common @@ -94,3 +94,16 @@ upload_to_target_dir()
upload_one_curl "${dir}/${file}" "${dir}" >/dev/null } + +rename_symlink_name() +{ + [ "${BM_NAME}" == "${benchmark}" ] && return + + cd "$pack_to" + [ -f "${BM_NAME}".cgz ] || return + rm "${BM_NAME}".cgz + date=$(ls -F | grep -v "@" | grep -Eo "[0-9]{8}") + mv "${BM_NAME}"_"$date".cgz "${benchmark}"_"$date".cgz + + ln -s "${benchmark}"_"$date".cgz "${benchmark}".cgz +} diff --git a/tests/cci-depends b/tests/cci-depends index 8ac1d7e58..0684a1025 100755 --- a/tests/cci-depends +++ b/tests/cci-depends @@ -38,13 +38,6 @@ umask 002 chown .lkp "$pack_to" }
-check_shared_package "$benchmark" && { - ln -sf $BM_NAME.cgz $pack_to/$benchmark.cgz - echo "create symlink for shared package: $benchmark -> $BM_NAME" - - exit 0 -} - share_debian_package
distro_install_depends cci-depends @@ -59,4 +52,6 @@ fixup_arch_install $pack_arch
pack_benchmark_deps
+rename_symlink_name + upload_to_target_dir ${pack_to}
On Fri, Jan 29, 2021 at 11:26:44AM +0800, Wang Yong wrote:
pls ignore
Thanks, Yong
[before] $ ll $LKP_SRC/distro/depends/sysbench-cpu sysbench-cpu -> sysbench $ tree /srv/initrd/deps/$os/$os_arch/$os_version/ . ├── sysbench_20200903.cgz ├── sysbench.cgz -> sysbench_20200903.cgz └── sysbench-cpu.cgz -> sysbench.cgz
all cgz file under one directory, so we can generate symlink when depends file is a symlink
[after] $ tree /srv/initrd/deps/$os/$os_arch/$os_version/sysbench-cpu . ├── sysbench-cpu_20210128.cgz └── sysbench-cpu.cgz -> sysbench-cpu_20210128.cgz
now we upload cgz file through curl, it's not appropriate to generate symlink directly, now generate original cgz file and rename it
Signed-off-by: Wang Yong wangyong0117@qq.com
distro/common | 13 +++++++++++++ tests/cci-depends | 9 ++------- 2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/distro/common b/distro/common index 1fd7df4e8..da2a57a79 100755 --- a/distro/common +++ b/distro/common @@ -94,3 +94,16 @@ upload_to_target_dir()
upload_one_curl "${dir}/${file}" "${dir}" >/dev/null }
+rename_symlink_name() +{
- [ "${BM_NAME}" == "${benchmark}" ] && return
- cd "$pack_to"
- [ -f "${BM_NAME}".cgz ] || return
- rm "${BM_NAME}".cgz
- date=$(ls -F | grep -v "@" | grep -Eo "[0-9]{8}")
- mv "${BM_NAME}"_"$date".cgz "${benchmark}"_"$date".cgz
- ln -s "${benchmark}"_"$date".cgz "${benchmark}".cgz
+} diff --git a/tests/cci-depends b/tests/cci-depends index 8ac1d7e58..0684a1025 100755 --- a/tests/cci-depends +++ b/tests/cci-depends @@ -38,13 +38,6 @@ umask 002 chown .lkp "$pack_to" }
-check_shared_package "$benchmark" && {
- ln -sf $BM_NAME.cgz $pack_to/$benchmark.cgz
- echo "create symlink for shared package: $benchmark -> $BM_NAME"
- exit 0
-}
share_debian_package
distro_install_depends cci-depends @@ -59,4 +52,6 @@ fixup_arch_install $pack_arch
pack_benchmark_deps
+rename_symlink_name
upload_to_target_dir ${pack_to}
2.23.0