Bash script to build LFS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

210 lines
6.3 KiB

#!/usr/bin/env bash
if [[ $(pwd) =~ ^/sources/vim*$ ]]
then
chown --verbose --recursive tester .
else
echo "bad directory"
exit 1
fi
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
./configure --prefix=/usr
make
sed '/test_plugin_glvs/d' -i src/testdir/Make_all.mak
:>/tmp/vim-make-test-output.log
:>/tmp/vim-make-test-error.log
if ! su tester --command "TERM=xterm-256color LANG=en_US.UTF-8 make -j1 test" 1>/tmp/vim-make-test-output.log 2>/tmp/vim-make-test-error.log
then
echo "--- return code of make -j1 test is : $?"
fi
if grep FAILED /tmp/vim-make-test-output.log
then
nberrors=$(grep --after-context=2 FAILED /tmp/vim-make-test-output.log |grep --count "Found errors in")
echo "--- There is ${nberrors} errors"
if [[ ${nberrors} -gt 0 ]]
then
grep --after-context=2 FAILED /tmp/vim-make-test-output.log | grep 'Found errors in' | cut --delimiter=' ' --fields=4 | cut --delimiter='(' --fields=1 | while IFS= read -r failure
do
echo "--- Check failure : ${failure}"
case ${failure} in
#Test_1xterm_mouse_wheel)
# echo "Test is disabled"
# continue
#;;
#Test_aa_terminal_focus_events)
# echo "Test is disabled"
# continue
#;;
#Test_auto_complete_backwards_no_halt)
# echo "Test is disabled"
# continue
#;;
#Test_autocomplete_trigger)
# echo "Test is disabled"
# continue
#;;
#Test_conceal_double_width_wrap)
# echo "Test is disabled"
# continue
#;;
#Test_edit_complete_very_long_name)
# echo "Test is disabled"
# continue
#;;
#Test_exrc)
# echo "Test is disabled"
# continue
#;;
#Test_exit_callback_interval)
# echo "Test is disabled"
# continue
#;;
#Test_ex_mode_with_global)
# echo "Test is disabled"
# continue
#;;
#Test_getchar)
# echo "Test is disabled"
# continue
#;;
#Test_hlsearch)
# echo "Test is disabled"
# continue
#;;
#Test_insert_cleared_on_switch_to_term)
# echo "Test is disabled"
# continue
#;;
#Test_map_cmdkey)
# echo "Test is disabled"
# continue
#;;
#Test_nocatch_timer_garbage_collect)
# echo "Test is disabled"
# continue
#;;
#Test_normal11_showcmd)
# echo "Test is disabled"
# continue
#;;
#Test_notifications)
# echo "Test is disabled"
# continue
#;;
#Test_popupwin_filter_input_multibyte)
# echo "Test is disabled"
# continue
#;;
#Test_recalling_cmdline_with_mappings)
# echo "Test is disabled"
# continue
#;;
#Test_recording_status_in_ex_line)
# echo "Test is disabled"
# continue
#;;
#Test_redraw_listening)
# echo "Test is disabled"
# continue
#;;
#Test_smoothscroll_list)
# echo "Test is disabled"
# continue
#;;
#Test_smoothscroll_mouse_pos)
# echo "Test is disabled"
# continue
#;;
#Test_source_sandbox)
# echo "Test is disabled"
# continue
#;;
#Test_source_utf8)
# echo "Test is disabled"
# continue
#;;
#Test_spelldump)
# echo "Test is disabled"
# continue
#;;
#Test_statusline_visual)
# echo "Test is disabled"
# continue
#;;
#Test_tabpanel_many_tabpages)
# echo "Test is disabled"
# continue
#;;
#Test_terminal_getwinpos)
# echo "Test is disabled"
# continue
#;;
#Test_term_mouse_multiple_clicks_to_select_mode)
# echo "Test is disabled"
# continue
#;;
#Test_virtualedit_getpos_stable_past_eol_after_visual)
# echo "Test is disabled"
# continue
#;;
#Test_visual_gq_format)
# echo "Test is disabled"
# continue
#;;
#Test_win_execute_visual_redraw)
# echo "Test is disabled"
# continue
#;;
#Test_writedelay)
# echo "Test is disabled"
# continue
#;;
*)
echo "Critical error in tests : ${failure}"
exit 1
;;
esac
done
fi
fi
echo "--- End of tests"
make install
#ln -sv vim /usr/bin/vi
#for L in /usr/share/man/{,*/}man1/vim.1; do
# ln -sv vim.1 $(dirname $L)/vi.1
#done
ln --symbolic --force --verbose ../vim/vim92/doc /usr/share/doc/vim-9.2.0567
cat > /etc/vimrc << "EOF"
" Begin /etc/vimrc
" Ensure defaults are set before customizing settings, not after
source $VIMRUNTIME/defaults.vim
let skip_defaults_vim=1
set nocompatible
set backspace=2
set mouse=
syntax on
if (&term == "xterm") || (&term == "putty")
set background=dark
endif
" End /etc/vimrc
EOF
# vim -c ':options'
# set spelllang=en,ru
# set spell