summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild-aux/write-ifchanged2
-rwxr-xr-xtools/notsd-fixup17
-rwxr-xr-xtools/notsd-fixup--includes17
3 files changed, 18 insertions, 18 deletions
diff --git a/build-aux/write-ifchanged b/build-aux/write-ifchanged
index 185ceb0039..84dfd6e639 100755
--- a/build-aux/write-ifchanged
+++ b/build-aux/write-ifchanged
@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
outfile=$1
-tmpfile="$(dirname "$outfile")/.tmp${outfile##*/}"
+tmpfile="$(dirname "$outfile")/.tmp.${outfile##*/}.tmp"
cat > "$tmpfile" || exit $?
if cmp -s "$tmpfile" "$outfile"; then
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"
diff --git a/tools/notsd-fixup--includes b/tools/notsd-fixup--includes
index 315be32c8d..33218233d5 100755
--- a/tools/notsd-fixup--includes
+++ b/tools/notsd-fixup--includes
@@ -33,7 +33,7 @@ classify() {
case "$base" in
dns_type) d=src/grp-resolve/systemd-resolved;;
keyboard-keys) d=src/grp-udev/libudev-core;;
- af|arphrd|cap|errno) d=src/libbasic/include/basic;;
+ af|arphrd|cap|errno) d=src/libsystemd-basic/src;;
audit_type) d=src/libsystemd/src/sd-journal;;
*)
>&2 printf 'Unknown gperf base: %q\n' "$base"
@@ -57,7 +57,7 @@ classify() {
if [[ "$current_file" = */systemd-boot/* ]]; then
out private util.h
else
- out protected basic/util.h
+ out protected systemd-basic/util.h
fi
;;
*)
@@ -77,6 +77,9 @@ classify() {
*/include/*)
out protected "${file##*/include/}"
;;
+ */include-staging/*)
+ out protected "${file##*/include-staging/}"
+ ;;
*)
if [[ "${current_file%/*}" = "${file%/*}" ]]; then
out private "${file##*/}"
@@ -219,7 +222,6 @@ main() {
current_file="$1"
printf ' => %q %q\n' "$0" "$current_file"
set -o pipefail
- trap 'rm -f -- "$current_file.tmp"' EXIT
{
IFS=''
while read -r line; do
@@ -227,14 +229,7 @@ main() {
IFS=''
done
"$hook"
- } < "$current_file" > "$current_file.tmp"
- # I specificially don't use write-ifchanged because I don't want the
- # temporary file to have the .c suffix.
- if cmp -s "$current_file.tmp" "$current_file"; then
- rm -f "$current_file.tmp" || :
- else
- mv -Tf "$current_file.tmp" "$current_file"
- fi
+ } < "$current_file" | build-aux/write-ifchanged "$current_file"
}
main "$@"