From e6b2f6c0eed97150241c23f1fda31657694903c9 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Wed, 16 Dec 2020 14:22:16 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/vim.git#86943b30a6c1912a1d4a5c8ae867ee7b15d456c1 --- .gitignore | 1 + sources | 2 +- vim.csh | 2 +- vim.fish | 2 +- vim.sh | 38 ++++++++++++++++++++++++++------------ vim.spec | 22 ++++++++++++++-------- 6 files changed, 44 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index d0a1da5c..fd484a28 100644 --- a/.gitignore +++ b/.gitignore @@ -337,3 +337,4 @@ /vim-8.2-2108.tar.bz2 /vim-8.2-2115.tar.bz2 /vim-8.2-2143.tar.bz2 +/vim-8.2-2146.tar.bz2 diff --git a/sources b/sources index f22a5b29..8b65ba66 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (vim-8.2-2143.tar.bz2) = 5d2445b809cc6fd0fb070a300f90866ae17d777c75df8cd8339663c9a259b30844bf91be30e976c8b1a227c21afaee11a7b8a48d7e6c4ec5ec490433c414099f +SHA512 (vim-8.2-2146.tar.bz2) = 555ae2f895da829c4249a5ce211d5ac69f704a10bec5e8b51059af236ac919e1a68aa8d5a48f125998715c8fd697f38686b37bb9beff0a0321d8ffb41a5649fd diff --git a/vim.csh b/vim.csh index 3c956964..47df2215 100644 --- a/vim.csh +++ b/vim.csh @@ -11,7 +11,7 @@ switch ( $vim_cond-$vi_cond ) breaksw case -/usr/bin/vi: # apply only if founded vi is in expected dir from distro - alias vim "read -rep 'No vim found, using vi, press ENTER to continue' -n1 -t 20 -s && vi" + alias vim vi breaksw endsw diff --git a/vim.fish b/vim.fish index 2c20e474..a35220df 100644 --- a/vim.fish +++ b/vim.fish @@ -16,7 +16,7 @@ switch "$vim_cond-$vi_cond" case -/usr/bin/vi # apply only when no vim is installed and founded vi is in the expected dir from distro function vim - command read -p 'No vim found, using vi, press ENTER to continue' -n1 -t 20 -s && vi $argv + command vi $argv end end diff --git a/vim.sh b/vim.sh index 58c33000..26166937 100644 --- a/vim.sh +++ b/vim.sh @@ -1,18 +1,32 @@ +__vi_internal_vim_alias() +( + # run vim if installed + test -f /usr/bin/vim && exec /usr/bin/vim "$@" + + # run vi otherwise + test -f /usr/bin/vi && exec /usr/bin/vi "$@" +) + +__view_internal_vim_alias() +( + # run vim -R instead of view if vim installed + test -f /usr/bin/vim && exec /usr/bin/vim -R "$@" + + # run view otherwise + test -f /usr/bin/view && exec /usr/bin/view "$@" +) + + if [ -n "${BASH_VERSION-}" -o -n "${KSH_VERSION-}" -o -n "${ZSH_VERSION-}" ]; then - # This will avoid user defined aliases and possibly stuff defined earlier in the PATH. + # This will avoid user defined aliases case "$(command -v vim)-$(command -v vi)" in - /usr/bin/vim-/usr/bin/vi) + "/usr/bin/vim-/usr/bin/vi" | "-/usr/bin/vi") # apply only when founded vim and vi are in expected dirs from distro - alias vi=vim - alias view="vim -R" - ;; - -/usr/bin/vi) - # apply only if founded vi is in expected dir from distro - if [ -n "${ZSH_VERSION-}" ]; then - alias vim="read -t 10 -s -k 1 '?No vim found, using vi, press ENTER to continue...' && echo '' && vi" - else - alias vim="read -rep $'No vim found, using vi, press ENTER to continue...\n' -n1 -t 10 -s && vi" - fi + # we need to call a shell function to avoid shell restarts when vi/vim + # is being installed/uninstalled + alias vi=__vi_internal_vim_alias + alias view=__view_internal_vim_alias + alias vim=__vi_internal_vim_alias ;; esac fi diff --git a/vim.spec b/vim.spec index b8f0a65a..9dcb03d5 100644 --- a/vim.spec +++ b/vim.spec @@ -1,4 +1,4 @@ -%define patchlevel 2143 +%define patchlevel 2146 %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} %define WITH_SELINUX 1 %endif @@ -128,7 +128,7 @@ Summary: A minimal version of the VIM editor # conflicts in package because of manpage move (bug #1599663) Conflicts: %{name}-common < %{epoch}:8.1.1-1 # now vim-minimal ships vim.sh, vim.csh and vim.fish too, so we need to conflict -Conflicts: vim-enhanced < 2:8.2.1815-2 +Conflicts: vim-enhanced < 2:8.2.1885-2 Provides: vi Provides: %{_bindir}/vi @@ -746,9 +746,8 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %files minimal %dir %{_datadir}/fish/vendor_functions.d -%{_datadir}/fish/vendor_functions.d/vim.fish -%dir %{_sysconfdir}/profile.d -%config(noreplace) %{_sysconfdir}/profile.d/vim.* +%ghost %{_datadir}/fish/vendor_functions.d/vim.fish +%ghost %config(noreplace) %{_sysconfdir}/profile.d/vim.* %config(noreplace) %{_sysconfdir}/virc %{_bindir}/ex %{_bindir}/vi @@ -764,9 +763,8 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %files enhanced %dir %{_datadir}/fish/vendor_functions.d -%{_datadir}/fish/vendor_functions.d/vim.fish -%dir %{_sysconfdir}/profile.d -%config(noreplace) %{_sysconfdir}/profile.d/vim.* +%ghost %{_datadir}/fish/vendor_functions.d/vim.fish +%ghost %config(noreplace) %{_sysconfdir}/profile.d/vim.* %{_bindir}/vim %{_bindir}/rvim %{_bindir}/vimdiff @@ -826,6 +824,14 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %config(noreplace) %{_sysconfdir}/profile.d/vim-default-editor.* %changelog +* Wed Dec 16 2020 Zdenek Dohnal - 2:8.2.2146-1 +- patchlevel 2146 + +* Wed Dec 16 2020 Zdenek Dohnal - 2:8.2.2143-2 +- make profile files as ghosts to prevent further conflicts +- remove ownership of /etc/profile.d - rpmlinter reports it as an error +- remove interactive prompt from profile scripts + * Mon Dec 14 2020 Zdenek Dohnal - 2:8.2.2143-1 - patchlevel 2143