mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd
@ 2024-05-02 14:53 Ian Abbott
  2024-05-03  6:59 ` Alexander Dahl
  2024-05-03  9:14 ` [ptxdist] [PATCH v2] " Ian Abbott
  0 siblings, 2 replies; 11+ messages in thread
From: Ian Abbott @ 2024-05-02 14:53 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

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.

Move the auto-selections of LIBC_DL, LIBC_M, GCCLIBS_GCC_S, and NCURSES
from VIM to VIM_VIM because VIM_XXD does not appear to require them.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 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..2f7eba993 100644
--- a/rules/vim.in
+++ b/rules/vim.in
@@ -1,15 +1,7 @@
 ## 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
 	prompt "vim                           "
 	help
 	  Vim is an advanced text editor that seeks to provide the
@@ -18,12 +10,20 @@ menuconfig VIM
 
 if VIM
 
-comment "BusyBox' vi is selected!"
-	depends on BUSYBOX_VI
-
 config VIM_VIM
-	depends on !BUSYBOX_VI
 	bool "Vim Editor"
+	select LIBC_DL
+	select LIBC_M
+	select GCCLIBS_GCC_S
+	select NCURSES
+
+comment "BusyBox' vi is selected!"
+	depends on VIM_VIM && BUSYBOX_VI
+
+config VIM_VI_SYMLINK
+	depends on VIM_VIM && !BUSYBOX_VI
+	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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-02 14:53 [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd Ian Abbott
@ 2024-05-03  6:59 ` Alexander Dahl
  2024-05-03  9:12   ` Ian Abbott
  2024-05-03  9:14 ` [ptxdist] [PATCH v2] " Ian Abbott
  1 sibling, 1 reply; 11+ messages in thread
From: Alexander Dahl @ 2024-05-03  6:59 UTC (permalink / raw)
  To: Ian Abbott; +Cc: ptxdist

Hello Ian,

I like the idea.  Maybe it confuses users if 'vi' calls busybox and
'vim' the full featured Vim, but I appreciate it anyway.  More
feedback below.

Am Thu, May 02, 2024 at 03:53:22PM +0100 schrieb Ian Abbott:
> 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.
> 
> Move the auto-selections of LIBC_DL, LIBC_M, GCCLIBS_GCC_S, and NCURSES
> from VIM to VIM_VIM because VIM_XXD does not appear to require them.
> 
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  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..2f7eba993 100644
> --- a/rules/vim.in
> +++ b/rules/vim.in
> @@ -1,15 +1,7 @@
>  ## 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
>  	prompt "vim                           "
>  	help
>  	  Vim is an advanced text editor that seeks to provide the
> @@ -18,12 +10,20 @@ menuconfig VIM
>  
>  if VIM
>  
> -comment "BusyBox' vi is selected!"
> -	depends on BUSYBOX_VI
> -
>  config VIM_VIM
> -	depends on !BUSYBOX_VI
>  	bool "Vim Editor"
> +	select LIBC_DL
> +	select LIBC_M
> +	select GCCLIBS_GCC_S
> +	select NCURSES

Don't move this to the suboption, keep it in the original place but
add 'if VIM_VIM' like this:

    select LIBC_DL if VIM_VIM

This avoids dependency problems, it's also in documentation:
https://www.ptxdist.org/doc/dev_advanced_rule_files.html#managing-external-compile-time-dependencies-on-demand

> +
> +comment "BusyBox' vi is selected!"
> +	depends on VIM_VIM && BUSYBOX_VI
> +
> +config VIM_VI_SYMLINK
> +	depends on VIM_VIM && !BUSYBOX_VI

The !BUSYBOX_VI is redundant, but I guess one can keep it.

Greets
Alex

> +	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
> 
> 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-03  6:59 ` Alexander Dahl
@ 2024-05-03  9:12   ` Ian Abbott
  2024-05-03  9:40     ` Alexander Dahl
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Abbott @ 2024-05-03  9:12 UTC (permalink / raw)
  To: ptxdist

On 03/05/2024 07:59, Alexander Dahl wrote:
> Hello Ian,
> 
> I like the idea.  Maybe it confuses users if 'vi' calls busybox and
> 'vim' the full featured Vim, but I appreciate it anyway.  More
> feedback below.

Thanks for the review. Feedback below.

> Am Thu, May 02, 2024 at 03:53:22PM +0100 schrieb Ian Abbott:
>> --- a/rules/vim.in
>> +++ b/rules/vim.in
>> @@ -1,15 +1,7 @@
>>   ## 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
>>   	prompt "vim                           "
>>   	help
>>   	  Vim is an advanced text editor that seeks to provide the
>> @@ -18,12 +10,20 @@ menuconfig VIM
>>   
>>   if VIM
>>   
>> -comment "BusyBox' vi is selected!"
>> -	depends on BUSYBOX_VI
>> -
>>   config VIM_VIM
>> -	depends on !BUSYBOX_VI
>>   	bool "Vim Editor"
>> +	select LIBC_DL
>> +	select LIBC_M
>> +	select GCCLIBS_GCC_S
>> +	select NCURSES
> 
> Don't move this to the suboption, keep it in the original place but
> add 'if VIM_VIM' like this:
> 
>      select LIBC_DL if VIM_VIM
> 
> This avoids dependency problems, it's also in documentation:
> https://www.ptxdist.org/doc/dev_advanced_rule_files.html#managing-external-compile-time-dependencies-on-demand

OK, that makes sense.

>> +
>> +comment "BusyBox' vi is selected!"
>> +	depends on VIM_VIM && BUSYBOX_VI
>> +
>> +config VIM_VI_SYMLINK
>> +	depends on VIM_VIM && !BUSYBOX_VI
> 
> The !BUSYBOX_VI is redundant, but I guess one can keep it.

I'm not sure why it's redundant. I don't want this option and BUSYBOX_VI 
fighting over the symlink to /usr/bin/vi in the image.

> 
> Greets
> Alex
> 
>> +	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
>>
>>

Thanks again. I'll submit a v2 patch shortly.

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ptxdist] [PATCH v2] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-02 14:53 [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd Ian Abbott
  2024-05-03  6:59 ` Alexander Dahl
@ 2024-05-03  9:14 ` Ian Abbott
  2024-05-03 14:56   ` Michael Olbrich
  2024-05-03 18:01   ` [ptxdist] [PATCH v3] " Ian Abbott
  1 sibling, 2 replies; 11+ messages in thread
From: Ian Abbott @ 2024-05-03  9:14 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

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 <abbotti@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
 	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
+	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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-03  9:12   ` Ian Abbott
@ 2024-05-03  9:40     ` Alexander Dahl
  2024-05-03 12:24       ` Ian Abbott
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Dahl @ 2024-05-03  9:40 UTC (permalink / raw)
  To: Ian Abbott; +Cc: ptxdist

Hello Ian,

Am Fri, May 03, 2024 at 10:12:47AM +0100 schrieb Ian Abbott:
> On 03/05/2024 07:59, Alexander Dahl wrote:
> > Hello Ian,
> > 
> > I like the idea.  Maybe it confuses users if 'vi' calls busybox and
> > 'vim' the full featured Vim, but I appreciate it anyway.  More
> > feedback below.
> 
> Thanks for the review. Feedback below.
> 
> > Am Thu, May 02, 2024 at 03:53:22PM +0100 schrieb Ian Abbott:
> > > --- a/rules/vim.in
> > > +++ b/rules/vim.in
> > > @@ -1,15 +1,7 @@
> > >   ## 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
> > >   	prompt "vim                           "
> > >   	help
> > >   	  Vim is an advanced text editor that seeks to provide the
> > > @@ -18,12 +10,20 @@ menuconfig VIM
> > >   if VIM
> > > -comment "BusyBox' vi is selected!"
> > > -	depends on BUSYBOX_VI
> > > -
> > >   config VIM_VIM
> > > -	depends on !BUSYBOX_VI
> > >   	bool "Vim Editor"
> > > +	select LIBC_DL
> > > +	select LIBC_M
> > > +	select GCCLIBS_GCC_S
> > > +	select NCURSES
> > 
> > Don't move this to the suboption, keep it in the original place but
> > add 'if VIM_VIM' like this:
> > 
> >      select LIBC_DL if VIM_VIM
> > 
> > This avoids dependency problems, it's also in documentation:
> > https://www.ptxdist.org/doc/dev_advanced_rule_files.html#managing-external-compile-time-dependencies-on-demand
> 
> OK, that makes sense.
> 
> > > +
> > > +comment "BusyBox' vi is selected!"
> > > +	depends on VIM_VIM && BUSYBOX_VI
> > > +
> > > +config VIM_VI_SYMLINK
> > > +	depends on VIM_VIM && !BUSYBOX_VI
> > 
> > The !BUSYBOX_VI is redundant, but I guess one can keep it.
> 
> I'm not sure why it's redundant. I don't want this option and BUSYBOX_VI
> fighting over the symlink to /usr/bin/vi in the image.

Right, there should be only one package setting that symlink.

What I meant was: VIM_VIM already depends on !BUSYBOX_VI so if
VIM_VI_SYMLINK depends on VIM_VIM, then !BUSYBOX_VI is already
implicitly satisfied and stating it again is not strictly necessary.

IMHO: Keep it in, it better reflects the intention.

Greets
Alex

> 
> > 
> > Greets
> > Alex
> > 
> > > +	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
> > > 
> > > 
> 
> Thanks again. I'll submit a v2 patch shortly.
> 
> -- 
> -=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company  )=-
> -=( registered in England & Wales.  Regd. number: 02862268.  )=-
> -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
> -=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
> 
> 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-03  9:40     ` Alexander Dahl
@ 2024-05-03 12:24       ` Ian Abbott
  2024-05-03 12:29         ` Alexander Dahl
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Abbott @ 2024-05-03 12:24 UTC (permalink / raw)
  To: ptxdist

On 03/05/2024 10:40, Alexander Dahl wrote:
> Hello Ian,
> 
> Am Fri, May 03, 2024 at 10:12:47AM +0100 schrieb Ian Abbott:
>> On 03/05/2024 07:59, Alexander Dahl wrote:
>>> Am Thu, May 02, 2024 at 03:53:22PM +0100 schrieb Ian Abbott:
>>>> +
>>>> +comment "BusyBox' vi is selected!"
>>>> +	depends on VIM_VIM && BUSYBOX_VI
>>>> +
>>>> +config VIM_VI_SYMLINK
>>>> +	depends on VIM_VIM && !BUSYBOX_VI
>>>
>>> The !BUSYBOX_VI is redundant, but I guess one can keep it.
>>
>> I'm not sure why it's redundant. I don't want this option and BUSYBOX_VI
>> fighting over the symlink to /usr/bin/vi in the image.
> 
> Right, there should be only one package setting that symlink.
> 
> What I meant was: VIM_VIM already depends on !BUSYBOX_VI so if
> VIM_VI_SYMLINK depends on VIM_VIM, then !BUSYBOX_VI is already
> implicitly satisfied and stating it again is not strictly necessary.

Actually, my patch removed the dependency of VIM_VIM on !BUSYBOX_VI so 
that /usr/bin/vim can be installed alongside busybox's /usr/bin/vi.

I'm not sure if there is a valid use case for installing both busybox vi 
and vim. Obviously it would use more space in the image, but if busybox 
is already running, running busybox's vi should be less memory hungry 
than running vim.

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-03 12:24       ` Ian Abbott
@ 2024-05-03 12:29         ` Alexander Dahl
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Dahl @ 2024-05-03 12:29 UTC (permalink / raw)
  To: Ian Abbott; +Cc: ptxdist

Hello Ian,

Am Fri, May 03, 2024 at 01:24:15PM +0100 schrieb Ian Abbott:
> On 03/05/2024 10:40, Alexander Dahl wrote:
> > Hello Ian,
> > 
> > Am Fri, May 03, 2024 at 10:12:47AM +0100 schrieb Ian Abbott:
> > > On 03/05/2024 07:59, Alexander Dahl wrote:
> > > > Am Thu, May 02, 2024 at 03:53:22PM +0100 schrieb Ian Abbott:
> > > > > +
> > > > > +comment "BusyBox' vi is selected!"
> > > > > +	depends on VIM_VIM && BUSYBOX_VI
> > > > > +
> > > > > +config VIM_VI_SYMLINK
> > > > > +	depends on VIM_VIM && !BUSYBOX_VI
> > > > 
> > > > The !BUSYBOX_VI is redundant, but I guess one can keep it.
> > > 
> > > I'm not sure why it's redundant. I don't want this option and BUSYBOX_VI
> > > fighting over the symlink to /usr/bin/vi in the image.
> > 
> > Right, there should be only one package setting that symlink.
> > 
> > What I meant was: VIM_VIM already depends on !BUSYBOX_VI so if
> > VIM_VI_SYMLINK depends on VIM_VIM, then !BUSYBOX_VI is already
> > implicitly satisfied and stating it again is not strictly necessary.
> 
> Actually, my patch removed the dependency of VIM_VIM on !BUSYBOX_VI so that
> /usr/bin/vim can be installed alongside busybox's /usr/bin/vi.

You're right.  I did not look close enough.  Sorry for the noise then.

> I'm not sure if there is a valid use case for installing both busybox vi and
> vim. Obviously it would use more space in the image, but if busybox is
> already running, running busybox's vi should be less memory hungry than
> running vim.

Could confuse users, but otherwise, I think it's fine to make that
possible in ptxdist.  Developer can decide then.

Greets
Alex




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] [PATCH v2] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-03  9:14 ` [ptxdist] [PATCH v2] " Ian Abbott
@ 2024-05-03 14:56   ` Michael Olbrich
  2024-05-03 18:01   ` [ptxdist] [PATCH v3] " Ian Abbott
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Olbrich @ 2024-05-03 14:56 UTC (permalink / raw)
  To: Ian Abbott; +Cc: ptxdist

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 <abbotti@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 |



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ptxdist] [PATCH v3] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-03  9:14 ` [ptxdist] [PATCH v2] " Ian Abbott
  2024-05-03 14:56   ` Michael Olbrich
@ 2024-05-03 18:01   ` Ian Abbott
  2024-05-03 18:08     ` [ptxdist] [PATCH v4] " Ian Abbott
  1 sibling, 1 reply; 11+ messages in thread
From: Ian Abbott @ 2024-05-03 18:01 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

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 <abbotti@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

v3: Applied changes requested by Michael Olbrich. (1) Align the 'if ...'
with tabs. [Actually, there is now only one 'if ...' now! -- IA] (2) vim
is still compiled even if VIM_VIM is disabled, so leave the NCURSES
dependency as is. (3) Remove GCCLIBC_GCC_S and LIBC_DL dependencies as
they are no longer used. (4) Add '|| ALLYES' dependency to conditionally
built items for better build tests.
---
 rules/vim.in   | 22 ++++++++++------------
 rules/vim.make |  4 ++++
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/rules/vim.in b/rules/vim.in
index c4c9d14e6..d16b54a2d 100644
--- a/rules/vim.in
+++ b/rules/vim.in
@@ -1,14 +1,8 @@
 ## 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 LIBC_M	if VIM_VIM
 	select NCURSES
 	prompt "vim                           "
 	help
@@ -18,18 +12,22 @@ 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 || ALLYES
+	bool "install symbolic link /usr/bin/vi"
+	default y
+
 comment "BusyBox' xxd is selected!"
 	depends on BUSYBOX_XXD
 
 config VIM_XXD
-	depends on !BUSYBOX_XXD
+	depends on !BUSYBOX_XXD || ALLYES
 	bool "XXD"
 
 endif
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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ptxdist] [PATCH v4] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-03 18:01   ` [ptxdist] [PATCH v3] " Ian Abbott
@ 2024-05-03 18:08     ` Ian Abbott
  2024-05-12 13:16       ` [ptxdist] [APPLIED] " Michael Olbrich
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Abbott @ 2024-05-03 18:08 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

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-selection of LIBC_M depend on VIM_VIM because VIM_XXD does
not appear to require it.  While we are at it, remove the obsolete
GCCLIBS_GCC_S and LIBC_DL selections.

Signed-off-by: Ian Abbott <abbotti@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

v3: Applied changes requested by Michael Olbrich. (1) Align the 'if ...'
with tabs. [Actually, there is now only one 'if ...' now! -- IA] (2) vim
is still compiled even if VIM_VIM is disabled, so leave the NCURSES
dependency as is. (3) Remove GCCLIBC_GCC_S and LIBC_DL dependencies as
they are no longer used. (4) Add '|| ALLYES' dependency to conditionally
built items for better build tests.

v4: Updated commit description which I forgot to do in v3.
---
 rules/vim.in   | 22 ++++++++++------------
 rules/vim.make |  4 ++++
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/rules/vim.in b/rules/vim.in
index c4c9d14e6..d16b54a2d 100644
--- a/rules/vim.in
+++ b/rules/vim.in
@@ -1,14 +1,8 @@
 ## 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 LIBC_M	if VIM_VIM
 	select NCURSES
 	prompt "vim                           "
 	help
@@ -18,18 +12,22 @@ 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 || ALLYES
+	bool "install symbolic link /usr/bin/vi"
+	default y
+
 comment "BusyBox' xxd is selected!"
 	depends on BUSYBOX_XXD
 
 config VIM_XXD
-	depends on !BUSYBOX_XXD
+	depends on !BUSYBOX_XXD || ALLYES
 	bool "XXD"
 
 endif
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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ptxdist] [APPLIED] vim: allow vim to be installed alongside busybox vi and xxd
  2024-05-03 18:08     ` [ptxdist] [PATCH v4] " Ian Abbott
@ 2024-05-12 13:16       ` Michael Olbrich
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Olbrich @ 2024-05-12 13:16 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

Thanks, applied as e859fea01e033f691efac8124902478f8496233c.

Michael

[sent from post-receive hook]

On Sun, 12 May 2024 15:16:40 +0200, Ian Abbott <abbotti@mev.co.uk> 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-selection of LIBC_M depend on VIM_VIM because VIM_XXD does
> not appear to require it.  While we are at it, remove the obsolete
> GCCLIBS_GCC_S and LIBC_DL selections.
> 
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> Message-Id: <20240503180814.636648-1-abbotti@mev.co.uk>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/vim.in b/rules/vim.in
> index c4c9d14e6833..d16b54a2deb1 100644
> --- a/rules/vim.in
> +++ b/rules/vim.in
> @@ -1,14 +1,8 @@
>  ## 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 LIBC_M	if VIM_VIM
>  	select NCURSES
>  	prompt "vim                           "
>  	help
> @@ -18,18 +12,22 @@ 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 || ALLYES
> +	bool "install symbolic link /usr/bin/vi"
> +	default y
> +
>  comment "BusyBox' xxd is selected!"
>  	depends on BUSYBOX_XXD
>  
>  config VIM_XXD
> -	depends on !BUSYBOX_XXD
> +	depends on !BUSYBOX_XXD || ALLYES
>  	bool "XXD"
>  
>  endif
> diff --git a/rules/vim.make b/rules/vim.make
> index b03778e53f53..8700b70bdd82 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)
>  



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-05-12 13:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 14:53 [ptxdist] [PATCH] vim: allow vim to be installed alongside busybox vi and xxd Ian Abbott
2024-05-03  6:59 ` Alexander Dahl
2024-05-03  9:12   ` Ian Abbott
2024-05-03  9:40     ` Alexander Dahl
2024-05-03 12:24       ` Ian Abbott
2024-05-03 12:29         ` Alexander Dahl
2024-05-03  9:14 ` [ptxdist] [PATCH v2] " Ian Abbott
2024-05-03 14:56   ` Michael Olbrich
2024-05-03 18:01   ` [ptxdist] [PATCH v3] " Ian Abbott
2024-05-03 18:08     ` [ptxdist] [PATCH v4] " Ian Abbott
2024-05-12 13:16       ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox