diff options
author | Colin Watson <cjwatson@debian.org> | 2020-09-20 16:14:20 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-09-20 16:14:20 +0100 |
commit | 173bfbf7886608a4a7abbfac6a42ac4bf4a3432d (patch) | |
tree | b97833d8754f257f92d99dd2f5c9e9d557e3f689 /src/diff_exports.sh | |
parent | 75073d0a8478441cc97a6efa10b566c5fb1dac81 (diff) |
New upstream version 1.5.0
Diffstat (limited to 'src/diff_exports.sh')
-rwxr-xr-x | src/diff_exports.sh | 29 |
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 | 7 | for f in export.gnu export.llvm export.msvc; do |
8 | if [ ! -f "${f}" ]; then | ||
9 | exit 1 | ||
10 | fi | ||
11 | done | ||
8 | 12 | ||
9 | TMPDIR=$(mktemp -d) | 13 | TMPDIR="$(mktemp -d)" |
10 | GNU=${TMPDIR}/gnu | 14 | GNU="${TMPDIR}/gnu" |
11 | LLVM=${TMPDIR}/llvm | 15 | LLVM="${TMPDIR}/llvm" |
12 | MSVC=${TMPDIR}/msvc | 16 | MSVC="${TMPDIR}/msvc" |
13 | 17 | ||
14 | egrep -o $'([^*{}\t]+);$' export.gnu | tr -d ';' | sort > ${GNU} | 18 | awk '/^[^*{}]+;$/' export.gnu | tr -d '\t;' | sort > "${GNU}" |
15 | sed 's/^_//g' export.llvm | sort > ${LLVM} | 19 | sed 's/^_//' export.llvm | sort > "${LLVM}" |
16 | egrep -v "^EXPORTS$" export.msvc | sort > ${MSVC} | 20 | grep -v '^EXPORTS$' export.msvc | sort > "${MSVC}" |
17 | diff -u ${GNU} ${LLVM} && diff -u ${MSVC} ${LLVM} | 21 | diff -u "${GNU}" "${LLVM}" && diff -u "${MSVC}" "${LLVM}" |
18 | ERROR=$? | 22 | ERROR=$? |
19 | 23 | rm "${GNU}" "${LLVM}" "${MSVC}" | |
20 | rm ${GNU} ${LLVM} ${MSVC} | 24 | rmdir "${TMPDIR}" |
21 | rmdir ${TMPDIR} | ||
22 | 25 | ||
23 | exit ${ERROR} | 26 | exit ${ERROR} |