Improve readonly-paths-from-var performance
This commit is contained in:
parent
9e4e4b82d4
commit
6c68b722cc
1 changed files with 4 additions and 5 deletions
|
|
@ -31,11 +31,10 @@ in
|
|||
assert lib.isValidPosixName var;
|
||||
include-once "readonly-paths-from-var-${var}" (add-runtime ''
|
||||
IFS=${lib.escapeShellArg separator} read -ra DIRS <<< "''${${var}-}"
|
||||
for DIR in "''${DIRS[@]}"; do
|
||||
if [ -e "$DIR" ]; then
|
||||
P="$(realpath "$DIR")"
|
||||
if ((''${#DIRS[@]})); then
|
||||
while IFS= read -r -d ''' P; do
|
||||
RUNTIME_ARGS+=(--ro-bind "$P" "$P")
|
||||
fi
|
||||
done
|
||||
done < <(realpath -ezq -- "''${DIRS[@]}")
|
||||
fi
|
||||
'');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue