diff mbox series

[2/2] dash: enable line editting if libedit is selected.

Message ID 1506530514-27185-2-git-send-email-casantos@datacom.ind.br
State Rejected, archived
Headers show
Series [1/2] dash: bump to version 0.5.9.1 | expand

Commit Message

Carlos Santos Sept. 27, 2017, 4:41 p.m. UTC
Also, add a profile snippet enabling line editing, Emacs style.

Change-Id: I68c6dbbafa95e266860329cb9c7ff5519fda5bf8
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/dash/dash.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Thomas Petazzoni Sept. 27, 2017, 7:18 p.m. UTC | #1
Hello,

On Wed, 27 Sep 2017 13:41:54 -0300, Carlos Santos wrote:

> +# Enable line editing, Emacs style
> +define DASH_INSTALL_PROFILE
> +	echo 'set -E' > $(TARGET_DIR)/etc/profile.d/dash.sh
> +endef

This really looks like a "personal preference" configuration, that is
more relevant in a custom rootfs overlay, no?

> +ifeq ($(BR2_PACKAGE_LIBEDIT),y)
> +DASH_DEPENDENCIES += libedit
> +DASH_CONF_OPTS += --with-libedit
> +DASH_POST_INSTALL_TARGET_HOOKS += DASH_INSTALL_PROFILE

What about --without-libedit in an else case ?

Thanks!

Thomas
Carlos Santos Sept. 27, 2017, 8:19 p.m. UTC | #2
> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot@buildroot.org
> Sent: Wednesday, September 27, 2017 4:18:05 PM
> Subject: Re: [Buildroot] [PATCH 2/2] dash: enable line editting if libedit is selected.

> Hello,
> 
> On Wed, 27 Sep 2017 13:41:54 -0300, Carlos Santos wrote:
> 
>> +# Enable line editing, Emacs style
>> +define DASH_INSTALL_PROFILE
>> +	echo 'set -E' > $(TARGET_DIR)/etc/profile.d/dash.sh
>> +endef
> 
> This really looks like a "personal preference" configuration, that is
> more relevant in a custom rootfs overlay, no?

This is the default behavior of BusyBox's shell, which is used in 98.73%
of the Buldroot installations, according to my statistics factory, so I
think we should use it by default.

>> +ifeq ($(BR2_PACKAGE_LIBEDIT),y)
>> +DASH_DEPENDENCIES += libedit
>> +DASH_CONF_OPTS += --with-libedit
>> +DASH_POST_INSTALL_TARGET_HOOKS += DASH_INSTALL_PROFILE
> 
> What about --without-libedit in an else case ?

In the case else there is no libedit to which not to link. :-)
Thomas Petazzoni Sept. 28, 2017, 6:59 a.m. UTC | #3
Hello,

On Wed, 27 Sep 2017 17:19:28 -0300 (BRT), Carlos Santos wrote:

> > This really looks like a "personal preference" configuration, that is
> > more relevant in a custom rootfs overlay, no?  
> 
> This is the default behavior of BusyBox's shell, which is used in 98.73%
> of the Buldroot installations, according to my statistics factory, so I
> think we should use it by default.

Hum, OK.

> >> +ifeq ($(BR2_PACKAGE_LIBEDIT),y)
> >> +DASH_DEPENDENCIES += libedit
> >> +DASH_CONF_OPTS += --with-libedit
> >> +DASH_POST_INSTALL_TARGET_HOOKS += DASH_INSTALL_PROFILE  
> > 
> > What about --without-libedit in an else case ?  
> 
> In the case else there is no libedit to which not to link. :-)

We always try to explicitly disable features, so that configure scripts
don't misdetect a system-installed libedit for example.

Best regards,

Thomas
Carlos Santos Sept. 28, 2017, 11:54 a.m. UTC | #4
> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot@buildroot.org
> Sent: Thursday, September 28, 2017 3:59:57 AM
> Subject: Re: [Buildroot] [PATCH 2/2] dash: enable line editting if libedit is selected.

> Hello,
> 
> On Wed, 27 Sep 2017 17:19:28 -0300 (BRT), Carlos Santos wrote:
> 
>> > This really looks like a "personal preference" configuration, that is
>> > more relevant in a custom rootfs overlay, no?
>> 
>> This is the default behavior of BusyBox's shell, which is used in 98.73%
>> of the Buldroot installations, according to my statistics factory, so I
>> think we should use it by default.
> 
> Hum, OK.
> 
>> >> +ifeq ($(BR2_PACKAGE_LIBEDIT),y)
>> >> +DASH_DEPENDENCIES += libedit
>> >> +DASH_CONF_OPTS += --with-libedit
>> >> +DASH_POST_INSTALL_TARGET_HOOKS += DASH_INSTALL_PROFILE
>> > 
>> > What about --without-libedit in an else case ?
>> 
>> In the case else there is no libedit to which not to link. :-)
> 
> We always try to explicitly disable features, so that configure scripts
> don't misdetect a system-installed libedit for example.

That's a good point. I will send an updated patch.
diff mbox series

Patch

diff --git a/package/dash/dash.mk b/package/dash/dash.mk
index 72ef722..5c26994 100644
--- a/package/dash/dash.mk
+++ b/package/dash/dash.mk
@@ -10,6 +10,17 @@  DASH_SITE = http://gondor.apana.org.au/~herbert/dash/files
 DASH_LICENSE = BSD-3-Clause, GPL-2.0+ (mksignames.c)
 DASH_LICENSE_FILES = COPYING
 
+# Enable line editing, Emacs style
+define DASH_INSTALL_PROFILE
+	echo 'set -E' > $(TARGET_DIR)/etc/profile.d/dash.sh
+endef
+
+ifeq ($(BR2_PACKAGE_LIBEDIT),y)
+DASH_DEPENDENCIES += libedit
+DASH_CONF_OPTS += --with-libedit
+DASH_POST_INSTALL_TARGET_HOOKS += DASH_INSTALL_PROFILE
+endif
+
 define DASH_INSTALL_TARGET_CMDS
 	$(INSTALL) -m 0755 $(@D)/src/dash $(TARGET_DIR)/bin/dash
 endef