From d14bc38a9d13abaf5a515104861d03f859ff7b17 Mon Sep 17 00:00:00 2001 From: nkraetzschmar <9020053+nkraetzschmar@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:13:42 +0200 Subject: [PATCH] fix: use file.include.stat instead of file.stat --- builder/configure.chroot | 19 ++++++++++++------- docs/features.md | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/builder/configure.chroot b/builder/configure.chroot index 6b6a093..8341b90 100755 --- a/builder/configure.chroot +++ b/builder/configure.chroot @@ -69,13 +69,18 @@ for feature in "${features[@]}"; do done for feature in "${features[@]}"; do - if [ -e "/builder/features/$feature/file.stat" ]; then - sed 's/#.*$//;/^[[:space:]]*$/d' "/builder/features/$feature/file.stat" | while read -r user group perm file; do - old_stat="$(stat -c '%A %U:%G' "$file")" - chown "$user:$group" "$file" - chmod "$perm" "$file" - new_stat="$(stat -c '%A %U:%G' "$file")" - printf '%s: %s -> %s\n' "$file" "$old_stat" "$new_stat" + if [ -e "/builder/features/$feature/file.include.stat" ]; then + sed 's/#.*$//;/^[[:space:]]*$/d' "/builder/features/$feature/file.include.stat" | while read -r user group perm files; do + set +f + shopt -s globstar + shopt -s nullglob + for file in $files; do + old_stat="$(stat -c '%A %U:%G' "$file")" + chown "$user:$group" "$file" + chmod "$perm" "$file" + new_stat="$(stat -c '%A %U:%G' "$file")" + printf '%s: %s -> %s\n' "$file" "$old_stat" "$new_stat" + done done fi done diff --git a/docs/features.md b/docs/features.md index 3f60f9c..e36c3a1 100644 --- a/docs/features.md +++ b/docs/features.md @@ -41,9 +41,9 @@ By default only the executable bit of the files permission will be preserved whe The other permissions will be set to read write for owner and read for group and other. The owner of all copied files will be root by default. -To overwrite these defaults see `file.stat` below +To overwrite these defaults see `file.include.stat` below -## `file.stat` +## `file.include.stat` A file to assign owner and permissions to files copied by `file.include`. Each line should contain an entry of the form: