inventory.sh: Get included directories
Not only wildcard
This commit is contained in:
parent
17d1f6069a
commit
07e2e8913e
12
inventory.sh
12
inventory.sh
|
@ -35,9 +35,15 @@ get_confs() {
|
|||
while [ "$confs_size" -lt "$(stat -c %s "$confs")" ]; do
|
||||
confs_size=$(stat -c %s "$confs")
|
||||
for conf_file in $(cat "$confs"); do
|
||||
# XXX: Expand the filenames
|
||||
for glob in $(awk '/^[[:space:]]*Include/ {print $2}' "$conf_file"); do
|
||||
realpath --canonicalize-existing --quiet $glob >> "$confs" || true
|
||||
# Get all Include directives
|
||||
for included in $(awk '/^[[:space:]]*Include/ {print $2}' "$conf_file"); do
|
||||
# In case a directory is included even tho it's not recomended
|
||||
if [ -d "$included" ]; then
|
||||
included=$included/*
|
||||
fi
|
||||
# XXX: Expand the filenames
|
||||
realpath --canonicalize-existing --quiet $included \
|
||||
| grep -v mods-available >> "$confs" || true
|
||||
done
|
||||
done
|
||||
sort "$confs" | uniq > "$confs"_tmp && mv "$confs"_tmp "$confs"
|
||||
|
|
Loading…
Reference in a new issue