diff options
author | ZyX <kp-pav@yandex.ru> | 2018-04-17 01:35:59 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2018-04-17 01:44:11 +0300 |
commit | cb3bb0becb74f46dfa88ff4be25833f55576c04e (patch) | |
tree | 7dc33aa87daecb416aa2d5665c61c916e6b60ce7 /scripts/pvscheck.sh | |
parent | 57c66bc168cb30a483b9fd13cb13e35bea5491bc (diff) | |
download | rneovim-cb3bb0becb74f46dfa88ff4be25833f55576c04e.tar.gz rneovim-cb3bb0becb74f46dfa88ff4be25833f55576c04e.tar.bz2 rneovim-cb3bb0becb74f46dfa88ff4be25833f55576c04e.zip |
pvscheck: Add --update switch
Diffstat (limited to 'scripts/pvscheck.sh')
-rwxr-xr-x | scripts/pvscheck.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index 9916a838b6..62051b191d 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -21,13 +21,14 @@ help() { echo 'Usage:' echo ' pvscheck.sh [--pvs URL] [--deps] [--environment-cc]' echo ' [target-directory [branch]]' - echo ' pvscheck.sh [--pvs URL] [--recheck] [--environment-cc]' + echo ' pvscheck.sh [--pvs URL] [--recheck] [--environment-cc] [--update]' echo ' [target-directory]' echo ' pvscheck.sh [--pvs URL] --only-analyse [target-directory]' echo ' pvscheck.sh [--pvs URL] --pvs-install {target-directory}' echo ' pvscheck.sh --patch [--only-build]' echo echo ' --pvs: Fetch pvs-studio from URL.' + echo echo ' --pvs detect: Auto-detect latest version (by scraping viva64.com).' echo echo ' --deps: (for regular run) Use top-level Makefile and build deps.' @@ -47,6 +48,8 @@ help() { echo echo ' --recheck: run analysis on a prepared target directory.' echo + echo ' --update: when rechecking first do a pull.' + echo echo ' --only-analyse: run analysis on a prepared target directory ' echo ' without building Neovim.' echo @@ -399,13 +402,24 @@ do_check() { install_pvs "$tgt" "$pvs_url" - do_recheck "$tgt" "$deps" "$environment_cc" + do_recheck "$tgt" "$deps" "$environment_cc" "" } do_recheck() { local tgt="$1" ; shift local deps="$1" ; shift local environment_cc="$1" ; shift + local update="$1" ; shift + + if test -n "$update" ; then + ( + cd "$tgt" + local branch="$(git rev-parse --abbrev-ref HEAD)" + git checkout --detach + git fetch -f origin "${branch}:${branch}" + git checkout -f "$branch" + ) + fi create_compile_commands "$tgt" "$deps" "$environment_cc" @@ -437,6 +451,7 @@ main() { pvs-install store_const \ deps store_const \ environment-cc store_const \ + update store_const \ -- \ 'modify realdir tgt "$PWD/../neovim-pvs"' \ 'store branch master' \ @@ -455,7 +470,7 @@ main() { elif test -n "$pvs_install" ; then install_pvs "$tgt" "$pvs_url" elif test -n "$recheck" ; then - do_recheck "$tgt" "$deps" "$environment_cc" + do_recheck "$tgt" "$deps" "$environment_cc" "$update" elif test -n "$only_analyse" ; then do_analysis "$tgt" else |