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