summaryrefslogtreecommitdiff
path: root/tools/notsd-fixup
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-10-23 12:10:04 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-10-26 21:19:51 -0400
commit434b9800e88bcc9e451b4c4b709e61f5a6992f49 (patch)
treea982ce229660e638b04f4c94f36d4d295f4749c1 /tools/notsd-fixup
parent782296ccf2049ef239130e7f1afe5bdb9bd12068 (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-xtools/notsd-fixup6
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() {