diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-10-23 12:10:04 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-10-26 21:19:51 -0400 |
commit | 434b9800e88bcc9e451b4c4b709e61f5a6992f49 (patch) | |
tree | a982ce229660e638b04f4c94f36d4d295f4749c1 /tools/notsd-fixup | |
parent | 782296ccf2049ef239130e7f1afe5bdb9bd12068 (diff) |
tools/notsd-fixup--includes: clean up, add caching
So now it should cache calls to `cpp` or filesystem checks, which are
comparatively expensive.
Diffstat (limited to 'tools/notsd-fixup')
-rwxr-xr-x | tools/notsd-fixup | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/notsd-fixup b/tools/notsd-fixup index 99ae0981a3..aa4bf4a10d 100755 --- a/tools/notsd-fixup +++ b/tools/notsd-fixup @@ -25,18 +25,18 @@ fixup_includes() ( dirs=($(find "$@" -type d -name include)) if [[ ${#dirs[@]} -gt 0 ]]; then find "${dirs[@]}" -type d | while read -r dir; do - printf '=> libdir %q\n' "$dir" lib="${dir##*/}" find "$dir" -type f | while read -r filename; do - printf ' => sed -ir %q %q\n' "s|$lib/||" "$filename" + >&2 printf ' => sed -r %q < %q\n' "s|$lib/||" "$filename" sed -r "s|$lib/||" < "$filename" | build-aux/write-ifchanged "$filename" done done fi find "$@" \( -name '*.h' -o -name '*.c' -o -name '*.gperf' \) -type f | while read -r filename; do - "$0"--includes "$filename" + "$0"--includes "$filename" | build-aux/write-ifchanged "$filename" done + rm -rf -- "$0"--includes.cache ) main() { |