Skip to content

Commit d14bc38

Browse files
committed
fix: use file.include.stat instead of file.stat
1 parent a9846fc commit d14bc38

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

builder/configure.chroot

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,18 @@ for feature in "${features[@]}"; do
6969
done
7070

7171
for feature in "${features[@]}"; do
72-
if [ -e "/builder/features/$feature/file.stat" ]; then
73-
sed 's/#.*$//;/^[[:space:]]*$/d' "/builder/features/$feature/file.stat" | while read -r user group perm file; do
74-
old_stat="$(stat -c '%A %U:%G' "$file")"
75-
chown "$user:$group" "$file"
76-
chmod "$perm" "$file"
77-
new_stat="$(stat -c '%A %U:%G' "$file")"
78-
printf '%s: %s -> %s\n' "$file" "$old_stat" "$new_stat"
72+
if [ -e "/builder/features/$feature/file.include.stat" ]; then
73+
sed 's/#.*$//;/^[[:space:]]*$/d' "/builder/features/$feature/file.include.stat" | while read -r user group perm files; do
74+
set +f
75+
shopt -s globstar
76+
shopt -s nullglob
77+
for file in $files; do
78+
old_stat="$(stat -c '%A %U:%G' "$file")"
79+
chown "$user:$group" "$file"
80+
chmod "$perm" "$file"
81+
new_stat="$(stat -c '%A %U:%G' "$file")"
82+
printf '%s: %s -> %s\n' "$file" "$old_stat" "$new_stat"
83+
done
7984
done
8085
fi
8186
done

docs/features.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ By default only the executable bit of the files permission will be preserved whe
4141
The other permissions will be set to read write for owner and read for group and other.
4242
The owner of all copied files will be root by default.
4343

44-
To overwrite these defaults see `file.stat` below
44+
To overwrite these defaults see `file.include.stat` below
4545

46-
## `file.stat`
46+
## `file.include.stat`
4747

4848
A file to assign owner and permissions to files copied by `file.include`.
4949
Each line should contain an entry of the form:

0 commit comments

Comments
 (0)