From: Yu Watanabe Date: Tue, 14 Jun 2022 00:11:00 +0000 (+0900) Subject: test: introduce inst_recursive() helper function X-Git-Tag: v252-rc1~808^2~6 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=da0465dc95388afc15598357452afef85035c639;p=systemd%2F.git test: introduce inst_recursive() helper function --- diff --git a/test/test-functions b/test/test-functions index ddf0f36ec3..f81afbe021 100644 --- a/test/test-functions +++ b/test/test-functions @@ -2630,6 +2630,20 @@ inst_any() { return 1 } +inst_recursive() { + local p item + + for p in "$@"; do + while read -r item; do + if [[ -d "$item" ]]; then + inst_dir "$item" + elif [[ -f "$item" ]]; then + inst_simple "$item" + fi + done < <(find "$p" 2>/dev/null) + done +} + # image_install [-o ] [ ... ] # Install to the test image # -o optionally install the and don't fail, if it is not there