]>
Commit | Line | Data |
---|---|---|
8244a877 LP |
1 | #!/bin/sh |
2 | # SPDX-License-Identifier: LGPL-2.1+ | |
3 | ||
12b74c38 LP |
4 | TOP=`git rev-parse --show-toplevel` |
5 | ||
8244a877 LP |
6 | case "$1" in |
7 | ||
8 | recdiff) | |
9 | if [ "$2" = "" ] ; then | |
12b74c38 | 10 | DIR="$TOP" |
8244a877 LP |
11 | else |
12 | DIR="$2" | |
13 | fi | |
14 | ||
15 | find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 diff \{\} \; | |
16 | ;; | |
17 | ||
18 | recpatch) | |
19 | if [ "$2" = "" ] ; then | |
12b74c38 | 20 | DIR="$TOP" |
8244a877 LP |
21 | else |
22 | DIR="$2" | |
23 | fi | |
24 | ||
25 | find $DIR -type f \( -name '*.[ch]' -o -name '*.xml' \) -exec $0 patch \{\} \; | |
26 | ;; | |
27 | ||
28 | diff) | |
29 | T=`mktemp` | |
30 | sed 's/\t/ /g' < "$2" > "$T" | |
31 | diff -u "$2" "$T" | |
32 | rm -f "$T" | |
33 | ;; | |
34 | ||
35 | patch) | |
36 | sed -i 's/\t/ /g' "$2" | |
37 | ;; | |
38 | ||
39 | *) | |
40 | echo "Expected recdiff|recpatch|diff|patch as verb." >&2 | |
41 | ;; | |
42 | esac |