From da0465dc95388afc15598357452afef85035c639 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 14 Jun 2022 09:11:00 +0900 Subject: [PATCH] test: introduce inst_recursive() helper function --- test/test-functions | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test-functions b/test/test-functions index ddf0f36ec38..f81afbe021c 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