]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: introduce inst_recursive() helper function
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 14 Jun 2022 00:11:00 +0000 (09:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 14 Jun 2022 11:59:32 +0000 (20:59 +0900)
test/test-functions

index ddf0f36ec38dc4ba5cecf2d65b1c13cc6f28bf48..f81afbe021c268b09823f15e5205a4a744817d8a 100644 (file)
@@ -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 ] <file> [<file> ... ]
 # Install <file> to the test image
 # -o optionally install the <file> and don't fail, if it is not there