From 4753c1ec3d970eabde5bb55120a4333e31a9a15e Mon Sep 17 00:00:00 2001 From: Bruce Lacey Date: Mon, 12 Dec 2016 15:26:11 -0800 Subject: [PATCH] Override cppcheck library & platform options (#691) * Using LIBRARY=[avr|gnu] git cppcheck ... will set the command line library= to the value * Using PLATFORM=[avr.xml|unix32.xml] git cppcheck ... will set the command line platform= to the value * Corrected logical if error when bootstapping a pristine repo References #672 --- .mystools/.bundle_runtime.sh | 4 ++-- .mystools/cppcheck/config/unix32.xml | 17 +++++++++++++++++ .mystools/cppcheck/options.sh | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .mystools/cppcheck/config/unix32.xml diff --git a/.mystools/.bundle_runtime.sh b/.mystools/.bundle_runtime.sh index 744e9ba..0a1560d 100755 --- a/.mystools/.bundle_runtime.sh +++ b/.mystools/.bundle_runtime.sh @@ -24,7 +24,7 @@ tools_dir() git_config_tools_dir='git config mysensors.toolsdir' # Set mysensors.toolsdir in git config if it hasn't been set - if [ ! $($git_config_tools_dir) -o ! -d $($git_config_tools_dir) ]; then + if [[ ! $($git_config_tools_dir) || ! -d "$($git_config_tools_dir)" ]]; then $git_config_tools_dir "$( cd "$(dirname "${BASH_SOURCE[0]}")"; git rev-parse --show-prefix )" git config alias.mystoolspath '![ -z "${GIT_PREFIX}" ] || cd ${GIT_PREFIX}; echo $(git rev-parse --show-cdup)$(git config mysensors.toolsdir)' fi @@ -86,7 +86,7 @@ runBundle() # $(git rev-parse --is-inside-work-tree --quiet >/dev/null 2>&1) || err "Working directory is not a git repository. aborting..." -if environment_outdated && [[ $(basename "${0}") != *bootstrap* ]]; then +if [[ $(basename "${0}") != *bootstrap* ]] && environment_outdated ; then err "Your environment is out of date... Re-run $(git mystoolspath)bootstrap-dev.sh and try again" fi diff --git a/.mystools/cppcheck/config/unix32.xml b/.mystools/cppcheck/config/unix32.xml new file mode 100644 index 0000000..bc4ca0e --- /dev/null +++ b/.mystools/cppcheck/config/unix32.xml @@ -0,0 +1,17 @@ + + + 8 + unsigned + + 2 + 4 + 4 + 8 + 4 + 8 + 12 + 4 + 4 + 2 + + diff --git a/.mystools/cppcheck/options.sh b/.mystools/cppcheck/options.sh index 5cc32d2..e6b4023 100755 --- a/.mystools/cppcheck/options.sh +++ b/.mystools/cppcheck/options.sh @@ -4,8 +4,8 @@ OPTIONS="--quiet \ --error-exitcode=1 \ --force \ --enable=style,information \ - --library=avr \ - --platform="${TOOLCONFIG}"/avr.xml \ + --library=${LIBRARY:-avr} \ + --platform="${TOOLCONFIG}"/${PLATFORM:-avr.xml} \ --includes-file="${TOOLCONFIG}"/includes.cfg \ --suppressions-list="${TOOLCONFIG}"/suppressions.cfg"