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