[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 | 11 +++++++++++ tests/cci-depends | 9 ++------- 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/distro/common b/distro/common index 1fd7df4e8..f3a9c3071 100755 --- a/distro/common +++ b/distro/common @@ -94,3 +94,14 @@ upload_to_target_dir()
upload_one_curl "${dir}/${file}" "${dir}" >/dev/null } + +rename_cgz_file() +{ + [ "${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 +} diff --git a/tests/cci-depends b/tests/cci-depends index 8ac1d7e58..4a7b78a41 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_cgz_file + upload_to_target_dir ${pack_to}