diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:22:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:22:44 +0000 |
commit | 1e6c93250172946eeb38e94a92a1fd12c9d3011e (patch) | |
tree | 8ca5e16dfc7ad6b3bf2738ca0a48408a950f8f7e /cppcheck.sh | |
parent | Update watch file (diff) | |
download | netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.tar.xz netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.zip |
Merging upstream version 1.11.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cppcheck.sh')
-rwxr-xr-x | cppcheck.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cppcheck.sh b/cppcheck.sh index 841f01d26..ebbeeaf8f 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -2,25 +2,24 @@ # echo >>/tmp/cppcheck.log "cppcheck ${*}" +# shellcheck disable=SC2230 cppcheck=$(which cppcheck 2>/dev/null || command -v cppcheck 2>/dev/null) [ -z "${cppcheck}" ] && echo >&2 "install cppcheck." && exit 1 -[ -x "/home/costa/src/cppcheck.git/cppcheck" ] && \ - cppcheck="/home/costa/src/cppcheck.git/cppcheck" - processors=$(grep -c ^processor /proc/cpuinfo) [ $(( processors )) -lt 1 ] && processors=1 base="$(dirname "${0}")" [ "${base}" = "." ] && base="${PWD}" -cd "${base}/src" || exit 1 +cd "${base}" || exit 1 [ ! -d "cppcheck-build" ] && mkdir "cppcheck-build" file="${1}" shift -[ "${file}" = "${base}" -o -z "${file}" ] && file="${base}/src" +# shellcheck disable=SC2235 +([ "${file}" = "${base}" ] || [ -z "${file}" ]) && file="${base}" "${cppcheck}" \ -j ${processors} \ |