[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/aliyun | 2 +- distro/archlinux | 2 +- distro/common | 12 ++++++++++++ distro/debian | 2 +- tests/cci-depends | 9 ++------- 5 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/distro/aliyun b/distro/aliyun index 598243d8e..5c234ada6 100755 --- a/distro/aliyun +++ b/distro/aliyun @@ -80,7 +80,7 @@ yum_download() yum_pack() { local target_dir=/opt/rpms - local date=$(date +"%Y%m%d") + date=$(date +"%Y%m%d")
local downloaded_rpms=$(find /var/ -type f -name "*.rpm")
diff --git a/distro/archlinux b/distro/archlinux index 3942080a6..3d576555c 100755 --- a/distro/archlinux +++ b/distro/archlinux @@ -50,7 +50,7 @@ pacman_download() pacman_pack() { local target_dir=/opt/pkgs - local date=$(date +"%Y%m%d") + date=$(date +"%Y%m%d")
local downloaded_pkgs=$(find_pacman_package)
diff --git a/distro/common b/distro/common index 1fd7df4e8..d1a3a5447 100755 --- a/distro/common +++ b/distro/common @@ -94,3 +94,15 @@ 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 + mv ${BM_NAME}_$date.cgz ${benchmark}_$date.cgz + + ln -sf ${benchmark}_$date.cgz ${benchmark}.cgz +} diff --git a/distro/debian b/distro/debian index 8821e3ddd..b07d395b6 100755 --- a/distro/debian +++ b/distro/debian @@ -99,7 +99,7 @@ fixup_perf()
pack() { - local date=$(date +"%Y%m%d") + date=$(date +"%Y%m%d")
[[ $(type -t fixup_$BM_NAME) = 'function' ]] && fixup_$BM_NAME
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}