On Fri, May 03, 2024 at 10:14:44AM +0100, Ian Abbott wrote:
> Commit ad2eb34a07ed ("vim: prevent file name conflicts with busybox")
> prevented vim being selected if busybox vi is selected. However, the vim
> package does not currently install /usr/bin/vi, so the only conflict is
> between vim's xxd and busybox's xxd.
> 
> Allow vim to be installed alongside busybox vi. Also add a configuration
> option to allow installation of a /usr/bin/vi symbolic link to
> /usr/bin/vim, but only allow it to be selected if busybox vi is not
> selected.
> 
> Make the auto-selections of LIBC_DL, LIBC_M, GCCLIBS_GCC_S, and NCURSES
> depend on VIM_VIM because VIM_XXD does not appear to require them.
> 
> Signed-off-by: Ian Abbott <abbo...@mev.co.uk>
> ---
> v2: Corrected dependency problem I introduced by moving the
> auto-selection of the required libraries from VIM to VIM_VIM.  I have
> move them back, but only select them if VIM_VIM is selected, as
> suggested by Alexander Dahl
> ---
>  rules/vim.in   | 24 ++++++++++++------------
>  rules/vim.make |  4 ++++
>  2 files changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/rules/vim.in b/rules/vim.in
> index c4c9d14e6..24772d969 100644
> --- a/rules/vim.in
> +++ b/rules/vim.in
> @@ -1,15 +1,11 @@
>  ## SECTION=editors
>  
> -comment "BusyBox' vi and xxd is selected!"
> -     depends on BUSYBOX_VI && BUSYBOX_XXD
> -
>  menuconfig VIM
>       tristate
> -     depends on !(BUSYBOX_VI && BUSYBOX_XXD)
> -     select LIBC_DL
> -     select LIBC_M
> -     select GCCLIBS_GCC_S
> -     select NCURSES
> +     select LIBC_DL if VIM_VIM
> +     select LIBC_M if VIM_VIM
> +     select GCCLIBS_GCC_S if VIM_VIM
> +     select NCURSES if VIM_VIM

1. Align the 'if ...' with tabs.
2. vim is still compiled even if VIM_VIM is disabled so ncurses still
   needed. So leave that dependency as is.
3. GCCLIBS_GCC_S LIBC_DL are actually no longer used. That was missed
   during some update in the past. Just remove those while at it.

>       prompt "vim                           "
>       help
>         Vim is an advanced text editor that seeks to provide the
> @@ -18,13 +14,17 @@ menuconfig VIM
>  
>  if VIM
>  
> -comment "BusyBox' vi is selected!"
> -     depends on BUSYBOX_VI
> -
>  config VIM_VIM
> -     depends on !BUSYBOX_VI
>       bool "Vim Editor"
>  
> +comment "BusyBox' vi is selected!"
> +     depends on VIM_VIM && BUSYBOX_VI
> +
> +config VIM_VI_SYMLINK
> +     depends on VIM_VIM && !BUSYBOX_VI

This should have a '|| ALLYES' at the end for better build tests.

Michael

> +     bool "install symbolic link /usr/bin/vi"
> +     default y
> +
>  comment "BusyBox' xxd is selected!"
>       depends on BUSYBOX_XXD
>  
> diff --git a/rules/vim.make b/rules/vim.make
> index b03778e53..8700b70bd 100644
> --- a/rules/vim.make
> +++ b/rules/vim.make
> @@ -103,6 +103,10 @@ VIM_INSTALL_OPT := \
>  
>  VIM_LINKS := ex rview rvim view vimdiff
>  
> +ifdef PTXCONF_VIM_VI_SYMLINK
> +VIM_LINKS += vi
> +endif
> +
>  $(STATEDIR)/vim.targetinstall:
>       @$(call targetinfo)
>  
> -- 
> 2.43.0
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Reply via email to