diff options
Diffstat (limited to 'src/diff_exports.sh')
-rwxr-xr-x | src/diff_exports.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/diff_exports.sh b/src/diff_exports.sh new file mode 100755 index 0000000..7920f47 --- /dev/null +++ b/src/diff_exports.sh | |||
@@ -0,0 +1,23 @@ | |||
1 | #!/bin/bash -u | ||
2 | |||
3 | # Copyright (c) 2018 Yubico AB. All rights reserved. | ||
4 | # Use of this source code is governed by a BSD-style | ||
5 | # license that can be found in the LICENSE file. | ||
6 | |||
7 | [[ ! -f export.gnu || ! -f export.llvm || ! -f export.msvc ]] && exit 1 | ||
8 | |||
9 | TMPDIR=$(mktemp -d) | ||
10 | GNU=${TMPDIR}/gnu | ||
11 | LLVM=${TMPDIR}/llvm | ||
12 | MSVC=${TMPDIR}/msvc | ||
13 | |||
14 | egrep -o $'([^*{}\t]+);$' export.gnu | tr -d ';' | sort > ${GNU} | ||
15 | sed 's/^_//g' export.llvm | sort > ${LLVM} | ||
16 | egrep -v "^EXPORTS$" export.msvc | sort > ${MSVC} | ||
17 | diff -u ${GNU} ${LLVM} && diff -u ${MSVC} ${LLVM} | ||
18 | ERROR=$? | ||
19 | |||
20 | rm ${GNU} ${LLVM} ${MSVC} | ||
21 | rmdir ${TMPDIR} | ||
22 | |||
23 | exit ${ERROR} | ||