1:255.16-alt1
[systemd_ALT.git] / tools / find-tabs.sh
blob6cea339ac6278787cc79a604f6657da23bbd50b5
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1-or-later
4 set -eu
6 TOP="$(git rev-parse --show-toplevel)"
8 case "${1:-}" in
9 recdiff)
10 if [ "${2:-}" = "" ] ; then
11 DIR="$TOP"
12 else
13 DIR="$2"
16 find "$DIR" -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec "$0" diff \{\} \;
19 recpatch)
20 if [ "${2:-}" = "" ] ; then
21 DIR="$TOP"
22 else
23 DIR="$2"
26 find "$DIR" -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec "$0" patch \{\} \;
29 diff)
30 T="$(mktemp)"
31 sed 's/\t/ /g' <"${2:?}" >"$T"
32 diff -u "$2" "$T"
33 rm -f "$T"
36 patch)
37 sed -i 's/\t/ /g' "${2:?}"
41 echo "Expected recdiff|recpatch|diff|patch as verb." >&2
43 esac