diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-19 19:04:00 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-19 19:04:00 +0300 |
commit | 9fd048d901e1191dc56066e4be70014c3387c9fe (patch) | |
tree | 35aa49c728ada319cc8f4b4b2d0cd740fa90161a | |
parent | 38b2bc9a883d88b5257673048f687c5ac1fe7446 (diff) | |
download | rneovim-9fd048d901e1191dc56066e4be70014c3387c9fe.tar.gz rneovim-9fd048d901e1191dc56066e4be70014c3387c9fe.tar.bz2 rneovim-9fd048d901e1191dc56066e4be70014c3387c9fe.zip |
scripts: Do not patch already patched sources in patch mode
Also do not patch header files, that is not needed.
-rwxr-xr-x | scripts/pvscheck.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index faa6f92c9a..e2d2a2eada 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -15,6 +15,7 @@ help() { echo ' pvscheck.sh --patch' echo echo ' --patch: patch sources in the current directory.' + echo ' Does not patch already patched files.' echo ' Does not run analysis.' echo echo ' --recheck: run analysis on a prepared target directory.' @@ -66,18 +67,22 @@ patch_sources() { get_pvs_comment local sh_script=' - cat pvs-comment "$1" > "$1.tmp" - mv "$1.tmp" "$1" + pvs_comment="$(cat pvs-comment ; echo -n EOS)" + filehead="$(head -c $(( ${#pvs_comment} - 3 )) "$1" ; echo -n EOS)" + if test "x$filehead" != "x$pvs_comment" ; then + cat pvs-comment "$1" > "$1.tmp" + mv "$1.tmp" "$1" + fi ' find \ src/nvim test/functional/fixtures test/unit/fixtures \ - -name '*.[ch]' \ + -name '*.c' \ -exec /bin/sh -c "$sh_script" - '{}' \; find \ build/src/nvim/auto build/config \ - -name '*.[ch]' -not -name '*.test-include.c' \ + -name '*.c' -not -name '*.test-include.c' \ -exec /bin/sh -c "$sh_script" - '{}' \; rm pvs-comment |