diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-05-07 00:13:44 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-05-07 00:13:44 +0200 |
commit | 9543748bda8bfcad015243a9d312cf203431b29f (patch) | |
tree | 29455f665fe933cd76ac6c1c90b9916898f9050d /build-aux/clang-analyzer.sh | |
parent | 0a7f6a2659b363e1d68202b9fd863b57f7420f4f (diff) | |
download | blogc-9543748bda8bfcad015243a9d312cf203431b29f.tar.gz blogc-9543748bda8bfcad015243a9d312cf203431b29f.tar.bz2 blogc-9543748bda8bfcad015243a9d312cf203431b29f.zip |
build: use yatr
Diffstat (limited to 'build-aux/clang-analyzer.sh')
-rwxr-xr-x | build-aux/clang-analyzer.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/build-aux/clang-analyzer.sh b/build-aux/clang-analyzer.sh new file mode 100755 index 0000000..1582b10 --- /dev/null +++ b/build-aux/clang-analyzer.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -ex + +PN="$(grep PACKAGE_TARNAME config.h | cut -d\" -f2)" +PV="$(grep PACKAGE_VERSION config.h | cut -d\" -f2)" +P="${PN}-clang-analyzer-${PV}" + +set +e +scan-build \ + --use-cc="${CC:-clang}" \ + -o reports \ + ${MAKE_CMD:-make} +RV=$? +set -e + +NUM_REPORTS=$(ls -1 reports | wc -l) +[[ ${NUM_REPORTS} -eq 0 ]] && exit ${RV} +[[ ${NUM_REPORTS} -eq 1 ]] + +REPORTS="reports/$(ls -1 reports)" +if [[ -d "${REPORTS}" ]]; then + mv "${REPORTS}" clang-analyzer + tar \ + -cvJf "${P}.tar.xz" \ + clang-analyzer + RV=1 +fi + +exit ${RV} |