summaryrefslogtreecommitdiff
path: root/tools/notsd-fixup
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-10-21 19:04:18 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-10-21 19:04:18 -0400
commit67cd422d20ffbd8be04e2a95803ef073b63237d0 (patch)
tree8b9c4bee052698ede19723535521af481ade49f2 /tools/notsd-fixup
parentf3bbbbc700b285242fde052a19c576389f830fef (diff)
pull tools/notsd-* changes from notsystemd/master
Diffstat (limited to 'tools/notsd-fixup')
-rwxr-xr-xtools/notsd-fixup17
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/notsd-fixup b/tools/notsd-fixup
index 77df56fff4..99ae0981a3 100755
--- a/tools/notsd-fixup
+++ b/tools/notsd-fixup
@@ -22,12 +22,17 @@ fixup_makefiles() (
)
fixup_includes() (
- find $(find . -type d -name include) -type d | while read -r dir; do
- lib="${dir##*/}"
- pushd "$dir" >/dev/null
- find . -type f -exec sed -ri -e "s|$lib/||" -- {} +
- popd >/dev/null
- done
+ 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"
+ 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"