On Mon, Nov 16, 2020 at 08:24:05PM +0800, Wang Yong wrote:
add archlinux pack method
Signed-off-by: Wang Yong wangyong0117@qq.com
distro/archlinux | 104 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100755 distro/archlinux
diff --git a/distro/archlinux b/distro/archlinux new file mode 100755 index 000000000..e6d7dce50 --- /dev/null +++ b/distro/archlinux @@ -0,0 +1,104 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0
+shopt -s nullglob
+. $LKP_SRC/lib/install.sh +. $LKP_SRC/distro/common +. $LKP_SRC/lib/debug.sh
+distro_install_depends() +{
- local script
- local bm="$1"
- local scripts=$(find $LKP_SRC/distro/depends/ -name "$bm" -o -name "${bm}.[0-9]")
- for script in $scripts
- do
script=$(basename $script)
packages=$(get_dependency_packages $DISTRO $script)
[ -z "$packages" ] && continue
echo install packages for $script: $packages
for pkg in $packages
do
pacman -Qqs ----noconfirm $pkg || pacman -Sy --noconfirm $pkg
^Is this the correct grammar?
done
- done
+}
+pack_benchmark() +{
- setup_proxy
- distro_install_depends lkp-dev
- # Process each benchmark
- for BM_NAME in $benchmark
- do
distro_install_depends $BM_NAME-dev || continue
Line changes
echo $LKP_SRC/sbin/pack -d $DISTRO -f -c -s $PKG_MNT/$pack_to $BM_NAME
(
$LKP_SRC/sbin/pack -d $DISTRO -f -c -s $PKG_MNT/$pack_to $BM_NAME
)
- done
+}
+pacman_download() +{
- echo "pacman -Sw --noconfirm $*"
- pacman -Sw --noconfirm "$@"
+}
+pacman_pack() +{
- local target_dir=/opt/pkgs
- local date=$(date +"%Y%m%d")
- local downloaded_pkgs=$(find /var/ -type f -name "*.pkg.tar.xz")
- [ "$downloaded_pkgs" ] || return
- mkdir -p $target_dir
- mv $downloaded_pkgs $target_dir
- find $target_dir | cpio --quiet -o -H newc --owner=root.root | gzip -n -9 >$pack_to/${BM_NAME}_$date.cgz
- ln -sf ${BM_NAME}_$date.cgz $pack_to/${BM_NAME}.cgz || return
- chown .lkp $pack_to/${BM_NAME}_$date.cgz $pack_to/${BM_NAME}.cgz || return
echo package installed to $pack_to/${BM_NAME}.cgz echo packages installed to $pack_to/${BM_NAME}.cgz
- ls $target_dir/*.pkg.tar.gz > $pack_to/.${BM_NAME}.packages
- rm -rf $target_dir
+}
+cleanup_downloaded_pkgs() +{
- find /var/ -type f -name "*.pkg.tar.xz" -exec rm -f -- '{}' ;
+}
+pack_benchmark_deps() +{
- setup_proxy
- for BM_NAME in $benchmark
- do
cleanup_downloaded_pkgs
^One more line
check_shared_package $BM_NAME
packages=$(echo $(get_dependency_packages $DISTRO $BM_NAME))
if pacman_download $packages; then
pacman_pack
else
echo "failed to pack-deps $BM_NAME" >&2
echo $? echo "exit $?" Thanks sunyukui
fi
- done
+}
2.23.0