mirror of
https://gitlab.freedesktop.org/emersion/libdisplay-info.git
synced 2024-12-25 21:59:08 +01:00
4e5df43659
This makes it easier to perform an operation on all EDID files at once, e.g. "test/edid-decode-diff.sh test/data/*.edid" to update all diffs at once. Signed-off-by: Simon Ser <contact@emersion.fr>
18 lines
375 B
Bash
Executable file
18 lines
375 B
Bash
Executable file
#!/bin/sh -eu
|
|
|
|
workdir="$(mktemp -d)"
|
|
cleanup() {
|
|
rm -rf "$workdir"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
edid="$1"
|
|
diff="${edid%.edid}.diff"
|
|
"$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ]
|
|
"$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ]
|
|
|
|
if [ -f "$diff" ]; then
|
|
patch "$workdir/ref" "$diff"
|
|
fi
|
|
|
|
diff -u "$workdir/ref" "$workdir/di"
|