summaryrefslogtreecommitdiff
path: root/src/bin/eet/diffeet
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-11-25 11:29:10 +0000
committerTom Hacohen <tom@stosb.com>2014-11-25 11:30:30 +0000
commitb395d7dbd47abadc0ac28e9ff5d5dc1827f66ac6 (patch)
tree6617384077e98bb444f32f12b24ca27059ca65fe /src/bin/eet/diffeet
parent29abdd9ca4a620fdb1e24ca10898a8bae9170901 (diff)
Eet: add diffeet a tool for diffing eet files.
This is not perfect at the moment, as the decoded output might change drastically in some cases, however this is still useful for the other cases. Anyway, we should fix the eet decoding to have a consistent order, so this will be more useful. @feature.
Diffstat (limited to 'src/bin/eet/diffeet')
-rwxr-xr-xsrc/bin/eet/diffeet55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/bin/eet/diffeet b/src/bin/eet/diffeet
new file mode 100755
index 0000000..eed785b
--- /dev/null
+++ b/src/bin/eet/diffeet
@@ -0,0 +1,55 @@
1#!/bin/sh
2
3DIFF=${DIFF-diff}
4
5cleanup() {
6 if [ ! -z "$TDIR" ]; then
7 rm -r "$TDIR"
8 fi
9}
10
11die() {
12 echo "$@"
13 echo "Aborting"
14 cleanup
15 exit 1
16}
17
18usage() {
19 die "Usage: diffeet <eet file> <eet file2> <section>"
20}
21
22decode_eet() {
23 eet -d "$1" "$SECTION" "$2"
24
25 if [ $? -ne 0 ]; then
26 die "Failed decoding eet file '$1'."
27 fi
28}
29
30EETFILE1="$1"
31EETFILE2="$2"
32SECTION="$3"
33
34if [ $# -ne 3 ]; then
35 usage
36fi
37
38TDIR=$(mktemp -d)
39
40if [ $? -ne 0 ]; then
41 die "Failed creating tempdir."
42fi
43
44TMP="$(basename $EETFILE1)"
45TARGET1="$TDIR/$TMP"
46TMP="$(basename $EETFILE2)"
47TARGET2="$TDIR/$TMP"
48
49# Decode the file
50decode_eet "$EETFILE1" "$TARGET1"
51decode_eet "$EETFILE2" "$TARGET2"
52
53$DIFF "$TARGET1" "$TARGET2"
54
55cleanup