mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge branch 'master' into luaviml'/lua
This commit is contained in:
82
scripts/genappimage.sh
Executable file
82
scripts/genappimage.sh
Executable file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
|
||||
########################################################################
|
||||
# Package the binaries built as an AppImage
|
||||
# By Simon Peter 2016
|
||||
# For more information, see http://appimage.org/
|
||||
########################################################################
|
||||
|
||||
# App arch, used by generate_appimage.
|
||||
if [ -z "$ARCH" ]; then
|
||||
export ARCH="$(arch)"
|
||||
fi
|
||||
|
||||
# App name, used by generate_appimage.
|
||||
APP=nvim
|
||||
|
||||
ROOT_DIR="$(git rev-parse --show-toplevel)"
|
||||
APP_BUILD_DIR="$ROOT_DIR/build"
|
||||
APP_DIR="$APP.AppDir"
|
||||
|
||||
# App version, used by generate_appimage.
|
||||
VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*')
|
||||
|
||||
########################################################################
|
||||
# Compile nvim and install it into AppDir
|
||||
########################################################################
|
||||
|
||||
# Build and install nvim into the AppImage
|
||||
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr"
|
||||
make install
|
||||
|
||||
########################################################################
|
||||
# Get helper functions and move to AppDir
|
||||
########################################################################
|
||||
|
||||
cd "$APP_BUILD_DIR"
|
||||
mkdir "$APP_DIR"
|
||||
|
||||
curl -Lo "$APP_BUILD_DIR"/appimage_functions.sh https://github.com/probonopd/AppImages/raw/master/functions.sh
|
||||
. ./appimage_functions.sh
|
||||
|
||||
# Copy desktop and icon file to AppDir for AppRun to pick them up.
|
||||
# get_apprun
|
||||
# get_desktop
|
||||
cp "$ROOT_DIR/runtime/nvim.desktop" "$APP_DIR/"
|
||||
cp "$ROOT_DIR/runtime/nvim.png" "$APP_DIR/"
|
||||
|
||||
cd "$APP_DIR"
|
||||
|
||||
# copy dependencies
|
||||
copy_deps
|
||||
# Move the libraries to usr/bin
|
||||
move_lib
|
||||
|
||||
# Delete stuff that should not go into the AppImage.
|
||||
# Delete dangerous libraries; see
|
||||
# https://github.com/probonopd/AppImages/blob/master/excludelist
|
||||
delete_blacklisted
|
||||
|
||||
########################################################################
|
||||
# AppDir complete. Now package it as an AppImage.
|
||||
########################################################################
|
||||
|
||||
# No need for a fancy script. AppRun can just be a symlink to nvim.
|
||||
ln -s usr/bin/nvim AppRun
|
||||
|
||||
cd "$APP_BUILD_DIR" # Get out of AppImage directory.
|
||||
|
||||
# Generate AppImage.
|
||||
# - Expects: $ARCH, $APP, $VERSION env vars
|
||||
# - Expects: ./$APP.AppDir/ directory
|
||||
# - Produces: ../out/$APP-$VERSION.glibc$GLIBC_NEEDED-$ARCH.AppImage
|
||||
generate_appimage
|
||||
|
||||
# NOTE: There is currently a bug in the `generate_appimage` function (see
|
||||
# https://github.com/probonopd/AppImages/issues/228) that causes repeated builds
|
||||
# that result in the same name to fail.
|
||||
# Moving the final executable to a different folder gets around this issue.
|
||||
|
||||
mv "$ROOT_DIR"/out/*.AppImage "$ROOT_DIR"/build/bin
|
||||
# Remove the (now empty) folder the AppImage was built in
|
||||
rmdir "$ROOT_DIR"/out
|
||||
@@ -41,6 +41,7 @@ funcsdata:close()
|
||||
gperfpipe:write([[
|
||||
%language=ANSI-C
|
||||
%global-table
|
||||
%readonly-tables
|
||||
%define initializer-suffix ,0,0,NULL,NULL
|
||||
%define word-array-name functions
|
||||
%define hash-function-name hash_internal_func_gperf
|
||||
|
||||
@@ -37,6 +37,8 @@ c_proto = Ct(
|
||||
fill * P('(') * fill * Cg(c_params, 'parameters') * fill * P(')') *
|
||||
Cg(Cc(false), 'async') *
|
||||
(fill * Cg((P('FUNC_API_SINCE(') * C(num ^ 1)) * P(')'), 'since') ^ -1) *
|
||||
(fill * Cg((P('FUNC_API_DEPRECATED_SINCE(') * C(num ^ 1)) * P(')'),
|
||||
'deprecated_since') ^ -1) *
|
||||
(fill * Cg((P('FUNC_API_ASYNC') * Cc(true)), 'async') ^ -1) *
|
||||
(fill * Cg((P('FUNC_API_NOEXPORT') * Cc(true)), 'noexport') ^ -1) *
|
||||
(fill * Cg((P('FUNC_API_NOEVAL') * Cc(true)), 'noeval') ^ -1) *
|
||||
@@ -134,6 +136,10 @@ for i,f in ipairs(shallowcopy(functions)) do
|
||||
os.exit(1)
|
||||
end
|
||||
f.since = tonumber(f.since)
|
||||
if f.deprecated_since ~= nil then
|
||||
f.deprecated_since = tonumber(f.deprecated_since)
|
||||
end
|
||||
|
||||
if startswith(f.name, "nvim_buf_") then
|
||||
ismethod = true
|
||||
elseif startswith(f.name, "nvim_win_") then
|
||||
@@ -247,8 +253,7 @@ for i = 1, #functions do
|
||||
end
|
||||
output:write('\n')
|
||||
output:write('\n if (args.size != '..#fn.parameters..') {')
|
||||
output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);')
|
||||
output:write('\n error->set = true;')
|
||||
output:write('\n api_set_error(error, kErrorTypeException, "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);')
|
||||
output:write('\n goto cleanup;')
|
||||
output:write('\n }\n')
|
||||
|
||||
@@ -273,8 +278,7 @@ for i = 1, #functions do
|
||||
output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;')
|
||||
end
|
||||
output:write('\n } else {')
|
||||
output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong type for argument '..j..', expecting '..param[1]..'");')
|
||||
output:write('\n error->set = true;')
|
||||
output:write('\n api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");')
|
||||
output:write('\n goto cleanup;')
|
||||
output:write('\n }\n')
|
||||
else
|
||||
@@ -314,7 +318,7 @@ for i = 1, #functions do
|
||||
output:write('error);\n')
|
||||
end
|
||||
-- and check for the error
|
||||
output:write('\n if (error->set) {')
|
||||
output:write('\n if (ERROR_SET(error)) {')
|
||||
output:write('\n goto cleanup;')
|
||||
output:write('\n }\n')
|
||||
else
|
||||
@@ -394,9 +398,9 @@ local function process_function(fn)
|
||||
|
||||
static int %s(lua_State *lstate)
|
||||
{
|
||||
Error err = {.set = false};
|
||||
Error err = ERROR_INIT;
|
||||
if (lua_gettop(lstate) != %i) {
|
||||
api_set_error(&err, Validation, "Expected %i argument%s");
|
||||
api_set_error(&err, kErrorTypeValidation, "Expected %i argument%s");
|
||||
return luaL_error(lstate, "%%s", err.msg);
|
||||
}
|
||||
]], lua_c_function_name, #fn.parameters, #fn.parameters,
|
||||
@@ -415,7 +419,7 @@ local function process_function(fn)
|
||||
write_shifted_output(output, string.format([[
|
||||
const %s %s = nlua_pop_%s(lstate, &err);
|
||||
|
||||
if (err.set) {
|
||||
if (ERROR_SET(&err)) {
|
||||
%s
|
||||
return luaL_error(lstate, "%%s", err.msg);
|
||||
}
|
||||
@@ -441,7 +445,7 @@ local function process_function(fn)
|
||||
write_shifted_output(output, string.format([[
|
||||
const %s ret = %s(%s);
|
||||
%s
|
||||
if (err.set) {
|
||||
if (ERROR_SET(&err)) {
|
||||
return luaL_error(lstate, "%%s", err.msg);
|
||||
}
|
||||
nlua_push_%s(lstate, ret);
|
||||
@@ -453,7 +457,7 @@ local function process_function(fn)
|
||||
write_shifted_output(output, string.format([[
|
||||
%s(%s);
|
||||
%s
|
||||
if (err.set) {
|
||||
if (ERROR_SET(&err)) {
|
||||
return luaL_error(lstate, "%%s", err.msg);
|
||||
}
|
||||
return 0;
|
||||
|
||||
413
scripts/pvscheck.sh
Executable file
413
scripts/pvscheck.sh
Executable file
@@ -0,0 +1,413 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
# Note: -u causes problems with posh, it barks at “undefined” $@ when no
|
||||
# arguments provided.
|
||||
test -z "$POSH_VERSION" && set -u
|
||||
|
||||
get_jobs_num() {
|
||||
local num="$(cat /proc/cpuinfo | grep -c "^processor")"
|
||||
num="$(echo $(( num + 1 )))"
|
||||
num="${num:-1}"
|
||||
echo $num
|
||||
}
|
||||
|
||||
help() {
|
||||
echo 'Usage:'
|
||||
echo ' pvscheck.sh [--pvs URL] [--deps] [target-directory [branch]]'
|
||||
echo ' pvscheck.sh [--pvs URL] [--recheck] [target-directory]'
|
||||
echo ' pvscheck.sh [--pvs URL] --pvs-install {target-directory}'
|
||||
echo ' pvscheck.sh --patch [--only-build]'
|
||||
echo
|
||||
echo ' --pvs: Use the specified URL as a path to pvs-studio archive.'
|
||||
echo ' By default latest tested version is used.'
|
||||
echo
|
||||
echo ' May use `--pvs detect` to try detecting latest version.'
|
||||
echo ' That assumes certain viva64.com site properties and'
|
||||
echo ' may be broken by the site update.'
|
||||
echo
|
||||
echo ' --deps: (for regular run) Use top-level Makefile and build deps.'
|
||||
echo ' Without this it assumes all dependencies are already'
|
||||
echo ' installed.'
|
||||
echo
|
||||
echo ' --only-build: (for --patch) Only patch files in ./build directory.'
|
||||
echo
|
||||
echo ' --pvs-install: Only install PVS-studio to the specified location.'
|
||||
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.'
|
||||
echo
|
||||
echo ' target-directory: Directory where build should occur.'
|
||||
echo ' Default: ../neovim-pvs'
|
||||
echo
|
||||
echo ' branch: Branch to check.'
|
||||
echo ' Default: master.'
|
||||
}
|
||||
|
||||
getopts_error() {
|
||||
printf '%s\n' "$1" >&2
|
||||
echo 'return 1'
|
||||
return 1
|
||||
}
|
||||
|
||||
# Usage `eval "$(getopts_long long_defs -- positionals_defs -- "$@")"`
|
||||
#
|
||||
# long_defs: list of pairs of arguments like `longopt action`.
|
||||
# positionals_defs: list of arguments like `action`.
|
||||
#
|
||||
# `action` is a space-separated commands:
|
||||
#
|
||||
# store_const [const] [varname] [default]
|
||||
# Store constant [const] (default 1) (note: eval’ed) if argument is present
|
||||
# (long options only). Assumes long option accepts no arguments.
|
||||
# store [varname] [default]
|
||||
# Store value. Assumes long option needs an argument.
|
||||
# run {func} [varname] [default]
|
||||
# Run function {func} and store its output to the [varname]. Assumes no
|
||||
# arguments accepted (long options only).
|
||||
# modify {func} [varname] [default]
|
||||
# Like run, but assumes a single argument, passed to function {func} as $1.
|
||||
#
|
||||
# All actions stores empty value if neither [varname] nor [default] are
|
||||
# present. [default] is evaled by top-level `eval`, so be careful. Also note
|
||||
# that no arguments may contain spaces, including [default] and [const].
|
||||
getopts_long() {
|
||||
local positional=
|
||||
local opt_bases=""
|
||||
while test $# -gt 0 ; do
|
||||
local arg="$1" ; shift
|
||||
local opt_base=
|
||||
local act=
|
||||
local opt_name=
|
||||
if test -z "$positional" ; then
|
||||
if test "$arg" = "--" ; then
|
||||
positional=0
|
||||
continue
|
||||
fi
|
||||
act="$1" ; shift
|
||||
opt_name="$(echo "$arg" | tr '-' '_')"
|
||||
opt_base="longopt_$opt_name"
|
||||
else
|
||||
if test "$arg" = "--" ; then
|
||||
break
|
||||
fi
|
||||
: $(( positional+=1 ))
|
||||
act="$arg"
|
||||
opt_name="arg_$positional"
|
||||
opt_base="positional_$positional"
|
||||
fi
|
||||
opt_bases="$opt_bases $opt_base"
|
||||
eval "local varname_$opt_base=$opt_name"
|
||||
local i=0
|
||||
for act_subarg in $act ; do
|
||||
eval "local act_$(( i+=1 ))_$opt_base=\"\$act_subarg\""
|
||||
done
|
||||
done
|
||||
# Process options
|
||||
local positional=0
|
||||
local force_positional=
|
||||
while test $# -gt 0 ; do
|
||||
local argument="$1" ; shift
|
||||
local opt_base=
|
||||
local has_equal=
|
||||
local equal_arg=
|
||||
local is_positional=
|
||||
if test "$argument" = "--" ; then
|
||||
force_positional=1
|
||||
continue
|
||||
elif test -z "$force_positional" && test "${argument#--}" != "$argument"
|
||||
then
|
||||
local opt_name="${argument#--}"
|
||||
local opt_name_striparg="${opt_name%%=*}"
|
||||
if test "$opt_name" = "$opt_name_striparg" ; then
|
||||
has_equal=0
|
||||
else
|
||||
has_equal=1
|
||||
equal_arg="${argument#*=}"
|
||||
opt_name="$opt_name_striparg"
|
||||
fi
|
||||
# Use trailing x to prevent stripping newlines
|
||||
opt_name="$(printf '%sx' "$opt_name" | tr '-' '_')"
|
||||
opt_name="${opt_name%x}"
|
||||
if test -n "$(printf '%sx' "$opt_name" | tr -d 'a-z_')" ; then
|
||||
getopts_error "Option contains invalid characters: $opt_name"
|
||||
fi
|
||||
opt_base="longopt_$opt_name"
|
||||
else
|
||||
: $(( positional+=1 ))
|
||||
opt_base="positional_$positional"
|
||||
is_positional=1
|
||||
fi
|
||||
if test -n "$opt_base" ; then
|
||||
eval "local occurred_$opt_base=1"
|
||||
|
||||
eval "local act_1=\"\$act_1_$opt_base\""
|
||||
eval "local varname=\"\$varname_$opt_base\""
|
||||
local need_val=
|
||||
local func=
|
||||
case "$act_1" in
|
||||
(store_const)
|
||||
eval "local const=\"\${act_2_${opt_base}:-1}\""
|
||||
eval "local varname=\"\${act_3_${opt_base}:-$varname}\""
|
||||
printf 'local %s=%s\n' "$varname" "$const"
|
||||
;;
|
||||
(store)
|
||||
eval "varname=\"\${act_2_${opt_base}:-$varname}\""
|
||||
need_val=1
|
||||
;;
|
||||
(run)
|
||||
eval "func=\"\${act_2_${opt_base}}\""
|
||||
eval "varname=\"\${act_3_${opt_base}:-$varname}\""
|
||||
printf 'local %s="$(%s)"\n' "$varname" "$func"
|
||||
;;
|
||||
(modify)
|
||||
eval "func=\"\${act_2_${opt_base}}\""
|
||||
eval "varname=\"\${act_3_${opt_base}:-$varname}\""
|
||||
need_val=1
|
||||
;;
|
||||
esac
|
||||
if test -n "$need_val" ; then
|
||||
local val=
|
||||
if test -z "$is_positional" ; then
|
||||
if test $has_equal = 1 ; then
|
||||
val="$equal_arg"
|
||||
else
|
||||
if test $# -eq 0 ; then
|
||||
getopts_error "Missing argument for $opt_name"
|
||||
fi
|
||||
val="$1" ; shift
|
||||
fi
|
||||
else
|
||||
val="$argument"
|
||||
fi
|
||||
local escaped_val="'$(printf "%s" "$val" | sed "s/'/'\\\\''/g")'"
|
||||
case "$act_1" in
|
||||
(store)
|
||||
printf 'local %s=%s\n' "$varname" "$escaped_val"
|
||||
;;
|
||||
(modify)
|
||||
printf 'local %s="$(%s %s)"\n' "$varname" "$func" "$escaped_val"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# Print default values when no values were provided
|
||||
local opt_base=
|
||||
for opt_base in $opt_bases ; do
|
||||
eval "local occurred=\"\${occurred_$opt_base:-}\""
|
||||
if test -n "$occurred" ; then
|
||||
continue
|
||||
fi
|
||||
eval "local act_1=\"\$act_1_$opt_base\""
|
||||
eval "local varname=\"\$varname_$opt_base\""
|
||||
case "$act_1" in
|
||||
(store)
|
||||
eval "local varname=\"\${act_2_${opt_base}:-$varname}\""
|
||||
eval "local default=\"\${act_3_${opt_base}:-}\""
|
||||
printf 'local %s=%s\n' "$varname" "$default"
|
||||
;;
|
||||
(store_const|run|modify)
|
||||
eval "local varname=\"\${act_3_${opt_base}:-$varname}\""
|
||||
eval "local default=\"\${act_4_${opt_base}:-}\""
|
||||
printf 'local %s=%s\n' "$varname" "$default"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
get_pvs_comment() {
|
||||
local tgt="$1" ; shift
|
||||
|
||||
cat > "$tgt/pvs-comment" << EOF
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check
|
||||
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
install_pvs() {(
|
||||
local tgt="$1" ; shift
|
||||
local pvs_url="$1" ; shift
|
||||
|
||||
cd "$tgt"
|
||||
|
||||
mkdir pvs-studio
|
||||
cd pvs-studio
|
||||
|
||||
curl -L -o pvs-studio.tar.gz "$pvs_url"
|
||||
tar xzf pvs-studio.tar.gz
|
||||
rm pvs-studio.tar.gz
|
||||
local pvsdir="$(find . -maxdepth 1 -mindepth 1)"
|
||||
find "$pvsdir" -maxdepth 1 -mindepth 1 -exec mv '{}' . \;
|
||||
rmdir "$pvsdir"
|
||||
)}
|
||||
|
||||
adjust_path() {
|
||||
if test -d "$tgt/pvs-studio" ; then
|
||||
local saved_pwd="$PWD"
|
||||
cd "$tgt/pvs-studio"
|
||||
export PATH="$PWD/bin${PATH+:}${PATH}"
|
||||
cd "$saved_pwd"
|
||||
fi
|
||||
}
|
||||
|
||||
create_compile_commands() {(
|
||||
local tgt="$1" ; shift
|
||||
local deps="$1" ; shift
|
||||
|
||||
export CC=clang
|
||||
export CFLAGS=' -O0 '
|
||||
|
||||
if test -z "$deps" ; then
|
||||
mkdir -p "$tgt/build"
|
||||
(
|
||||
cd "$tgt/build"
|
||||
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="$PWD/root"
|
||||
make -j"$(get_jobs_num)"
|
||||
)
|
||||
else
|
||||
(
|
||||
cd "$tgt"
|
||||
|
||||
make -j"$(get_jobs_num)" CMAKE_EXTRA_FLAGS=" -DCMAKE_INSTALL_PREFIX=$PWD/root -DCMAKE_BUILD_TYPE=Debug "
|
||||
)
|
||||
fi
|
||||
find "$tgt/build/src/nvim/auto" -name '*.test-include.c' -delete
|
||||
)}
|
||||
|
||||
# Warning: realdir below only cares about directories unlike realpath.
|
||||
#
|
||||
# realpath is not available in Ubuntu trusty yet.
|
||||
realdir() {(
|
||||
local dir="$1"
|
||||
cd "$dir"
|
||||
printf '%s\n' "$PWD"
|
||||
)}
|
||||
|
||||
patch_sources() {(
|
||||
local tgt="$1" ; shift
|
||||
local only_bulid="${1:-}"
|
||||
|
||||
get_pvs_comment "$tgt"
|
||||
|
||||
local sh_script='
|
||||
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
|
||||
'
|
||||
|
||||
cd "$tgt"
|
||||
|
||||
if test "$only_build" != "--only-build" ; then
|
||||
find \
|
||||
src/nvim test/functional/fixtures test/unit/fixtures \
|
||||
-name '*.c' \
|
||||
-exec /bin/sh -c "$sh_script" - '{}' \;
|
||||
fi
|
||||
|
||||
find \
|
||||
build/src/nvim/auto build/config \
|
||||
-name '*.c' -not -name '*.test-include.c' \
|
||||
-exec /bin/sh -c "$sh_script" - '{}' \;
|
||||
|
||||
rm pvs-comment
|
||||
)}
|
||||
|
||||
run_analysis() {(
|
||||
local tgt="$1" ; shift
|
||||
|
||||
cd "$tgt"
|
||||
|
||||
pvs-studio-analyzer \
|
||||
analyze \
|
||||
--threads "$(get_jobs_num)" \
|
||||
--output-file PVS-studio.log \
|
||||
--verbose \
|
||||
--file build/compile_commands.json \
|
||||
--sourcetree-root .
|
||||
|
||||
plog-converter -t xml -o PVS-studio.xml PVS-studio.log
|
||||
plog-converter -t errorfile -o PVS-studio.err PVS-studio.log
|
||||
plog-converter -t tasklist -o PVS-studio.tsk PVS-studio.log
|
||||
)}
|
||||
|
||||
do_check() {
|
||||
local tgt="$1" ; shift
|
||||
local branch="$1" ; shift
|
||||
local pvs_url="$1" ; shift
|
||||
local deps="$1" ; shift
|
||||
|
||||
git clone --branch="$branch" . "$tgt"
|
||||
|
||||
install_pvs "$tgt" "$pvs_url"
|
||||
|
||||
adjust_path "$tgt"
|
||||
|
||||
create_compile_commands "$tgt" "$deps"
|
||||
|
||||
run_analysis "$tgt"
|
||||
}
|
||||
|
||||
do_recheck() {
|
||||
local tgt="$1"
|
||||
|
||||
adjust_path "$tgt"
|
||||
|
||||
create_compile_commands "$tgt" "$deps"
|
||||
|
||||
run_analysis "$tgt"
|
||||
}
|
||||
|
||||
detect_url() {
|
||||
local url="${1:-detect}"
|
||||
if test "$url" = detect ; then
|
||||
curl -L 'https://www.viva64.com/en/pvs-studio-download-linux/' \
|
||||
| grep -o 'https\{0,1\}://[^"<>]\{1,\}/pvs-studio[^/"<>]*\.tgz'
|
||||
else
|
||||
printf '%s' "$url"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
local def_pvs_url="http://files.viva64.com/pvs-studio-6.15.21741.1-x86_64.tgz"
|
||||
eval "$(
|
||||
getopts_long \
|
||||
help store_const \
|
||||
pvs 'modify detect_url pvs_url "${def_pvs_url}"' \
|
||||
patch store_const \
|
||||
only-build 'store_const --only-build' \
|
||||
recheck store_const \
|
||||
pvs-install store_const \
|
||||
deps store_const \
|
||||
-- \
|
||||
'modify realdir tgt "$PWD/../neovim-pvs"' \
|
||||
'store branch master' \
|
||||
-- "$@"
|
||||
)"
|
||||
|
||||
if test -n "$help" ; then
|
||||
help
|
||||
return 0
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
if test -n "$patch" ; then
|
||||
patch_sources "$only_build" "$tgt"
|
||||
elif test -n "$pvs_install" ; then
|
||||
install_pvs "$tgt" "$pvs_url"
|
||||
elif test -n "$recheck" ; then
|
||||
do_recheck "$tgt"
|
||||
else
|
||||
do_check "$tgt" "$branch" "$pvs_url" "$deps"
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -18,6 +18,8 @@ set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
USE_CURRENT_COMMIT=${1:-no}
|
||||
|
||||
__sed=$( [ "$(uname)" = Darwin ] && echo 'sed -E' || echo 'sed -r' )
|
||||
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
@@ -51,15 +53,18 @@ echo "Release version: ${__VERSION}"
|
||||
$__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt
|
||||
if grep '(NVIM_API_PRERELEASE true)' CMakeLists.txt > /dev/null; then
|
||||
$__sed -i.bk 's/(NVIM_API_PRERELEASE) true/\1 false/' CMakeLists.txt
|
||||
cp build/funcs_data.mpack test/functional/fixtures/api_level_$__API_LEVEL.mpack
|
||||
build/bin/nvim --api-info > test/functional/fixtures/api_level_$__API_LEVEL.mpack
|
||||
git add test/functional/fixtures/api_level_$__API_LEVEL.mpack
|
||||
fi
|
||||
|
||||
echo "Building changelog since ${__LAST_TAG}..."
|
||||
__CHANGELOG="$(./scripts/git-log-pretty-since.sh "$__LAST_TAG" 'vim-patch:\S')"
|
||||
if ! test "$USE_CURRENT_COMMIT" = 'use-current-commit' ; then
|
||||
echo "Building changelog since ${__LAST_TAG}..."
|
||||
__CHANGELOG="$(./scripts/git-log-pretty-since.sh "$__LAST_TAG" 'vim-patch:\S')"
|
||||
|
||||
git add CMakeLists.txt
|
||||
git commit --edit -m "${__RELEASE_MSG} ${__CHANGELOG}"
|
||||
fi
|
||||
|
||||
git add CMakeLists.txt
|
||||
git commit --edit -m "${__RELEASE_MSG} ${__CHANGELOG}"
|
||||
git tag --sign -a v"${__VERSION}" -m "NVIM v${__VERSION}"
|
||||
|
||||
$__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) ""/\1 "-dev"/' CMakeLists.txt
|
||||
|
||||
@@ -136,19 +136,19 @@ preprocess_patch() {
|
||||
2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/\S*\<\%('${na_src}'\)@norm! d/\v(^diff)|%$
|
||||
' +w +q "$file"
|
||||
|
||||
# Remove channel.txt, netbeans.txt, os_*.txt, todo.txt, version*.txt, tags
|
||||
local na_doc='channel\.txt\|netbeans\.txt\|os_\w\+\.txt\|todo\.txt\|version\d\.txt\|tags'
|
||||
# Remove channel.txt, netbeans.txt, os_*.txt, todo.txt, version*.txt, tags
|
||||
local na_doc='channel\.txt\|netbeans\.txt\|os_\w\+\.txt\|term\.txt\|todo\.txt\|version\d\.txt\|tags'
|
||||
2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/\<\%('${na_doc}'\)\>@norm! d/\v(^diff)|%$
|
||||
' +w +q "$file"
|
||||
|
||||
# Remove "Last change ..." changes in doc files.
|
||||
2>/dev/null $nvim --cmd 'set dir=/tmp' +'%s/^@@.*\n.*For Vim version.*Last change.*\n.*For Vim version.*Last change.*//' +w +q "$file"
|
||||
|
||||
# Remove some testdir/Make_*.mak files
|
||||
# Remove some testdir/Make_*.mak files
|
||||
local na_src_testdir='Make_amiga.mak\|Make_dos.mak\|Make_ming.mak\|Make_vms.mms'
|
||||
2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/\<\%('${na_src_testdir}'\)\>@norm! d/\v(^diff)|%$
|
||||
' +w +q "$file"
|
||||
|
||||
|
||||
# Remove some *.po files. #5622
|
||||
local na_po='sjiscorr.c\|ja.sjis.po\|ko.po\|pl.cp1250.po\|pl.po\|ru.cp1251.po\|uk.cp1251.po\|zh_CN.cp936.po\|zh_CN.po\|zh_TW.po'
|
||||
2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/po/\<\%('${na_po}'\)\>@norm! d/\v(^diff)|%$
|
||||
|
||||
Reference in New Issue
Block a user