]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/find-double-newline.sh
sd-bus: if we receive an invalid dbus message, ignore and proceeed
[thirdparty/systemd.git] / tools / find-double-newline.sh
CommitLineData
5d13a15b
LP
1#!/bin/sh
2# SPDX-License-Identifier: LGPL-2.1+
3
12b74c38
LP
4TOP=`git rev-parse --show-toplevel`
5
5d13a15b
LP
6case "$1" in
7
8 recdiff)
9 if [ "$2" = "" ] ; then
12b74c38 10 DIR="$TOP"
5d13a15b
LP
11 else
12 DIR="$2"
13 fi
14
3dfd31c8 15 find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 diff \{\} \;
5d13a15b
LP
16 ;;
17
18 recpatch)
19 if [ "$2" = "" ] ; then
12b74c38 20 DIR="$TOP"
5d13a15b
LP
21 else
22 DIR="$2"
23 fi
24
3dfd31c8 25 find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 patch \{\} \;
5d13a15b
LP
26 ;;
27
28 diff)
29 T=`mktemp`
30 sed '/^$/N;/^\n$/D' < "$2" > "$T"
31 diff -u "$2" "$T"
32 rm -f "$T"
33 ;;
34
35 patch)
36 sed -i '/^$/N;/^\n$/D' "$2"
37 ;;
38
39 *)
40 echo "Expected recdiff|recpatch|diff|patch as verb." >&2
41 ;;
42esac