blob: 079eeec1cd407de13a2c48bd26cea15cad566be2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/bin/sh
set -e
CABAL_INSTALL="${CABAL_INSTALL:-cabal}"
cd "$(dirname $0)"
"$CABAL_INSTALL" build
bin="$("$CABAL_INSTALL" list-bin ghc-notes)"
cd "$(git rev-parse --show-toplevel)"
"$bin" broken-refs \
| grep -v "utils/notes-util/expected-broken-note-refs:" \
| sed 's/:[0-9]\+:[0-9]\+:/:/' \
> broken-note-refs
if diff -q utils/notes-util/expected-broken-note-refs broken-note-refs; then
printf "No unexpected broken note references"
else
printf "Found unexpected broken note references:\n\n"
diff -u utils/notes-util/expected-broken-note-refs broken-note-refs || true
if [[ "$1" == "-a" ]]; then
cp broken-note-refs utils/notes-util/expected-broken-note-refs
printf "\n"
printf "Accepted new broken note references."
else
exit 1
fi
fi
|