Skip to contentSkip to conversation

package/grep: fix busybox aliasing

PATCH New Angelo Compagnucci 2 participants 3 messages Feb 4, 2020 – Mar 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/grep: fix busybox aliasing

When grep package is selected, it should be installed at the same exact location where busybox installs it too, this way the grep/egrep/fgrep executables will end up overwriting the busybox provided ones. Busybox installs *grep executables in /bin, grep package in /usr/bin.

---
Changelog:
* Patch splitting as suggested by Peter

I tested manually chenghing the package to:

GREP_CONF_OPTS = SHELL=/bin/dash --exec-prefix=/

And this works. If /bin/sh is a link to /bin/zsh for example, it will not work cause the configure is not able to run on zsh.
I suppose that changing the default /bin/sh to something not sh compatible woulb break many other things.

 package/grep/grep.mk | 1 +
 1 file changed, 1 insertion(+)
package/grep/grep.mk +1 -0
index 96685b0..be3e53b 100644
@@ -10,6 +10,7 @@ GREP_SOURCE = grep-$(GREP_VERSION).tar.xz
 GREP_LICENSE = GPL-3.0+
 GREP_LICENSE_FILES = COPYING
 GREP_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
+GREP_CONF_OPTS = --exec-prefix=/
 
 # link with iconv if enabled
 ifeq ($(BR2_PACKAGE_LIBICONV),y)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 package/grep: fix busybox aliasing

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Angelo" == Angelo Compagnucci <[email protected]> writes:

When grep package is selected, it should be installed at the same exact location where busybox installs it too, this way the grep/egrep/fgrep executables will end up overwriting the busybox provided ones. Busybox installs *grep executables in /bin, grep package in /usr/bin.

Reworded slightly and committed, thanks.

Quoted 4 lines

---
Changelog:
* Patch splitting as suggested by Peter

Quoted 8 lines

I tested manually chenghing the package to:

GREP_CONF_OPTS = SHELL=/bin/dash --exec-prefix=/

And this works. If /bin/sh is a link to /bin/zsh for example, it will not work cause the configure is not able to run on zsh.
I suppose that changing the default /bin/sh to something not sh compatible woulb break many other things.

But that should never happen. A bunch of stuff will break if /bin/sh isn't working.

So what about the 2nd fix? I take it that fgrep/egrep are still installed with a #!/bin/bash shebang?

Either we do the SHELL= workaround or simply patch fgrep / egrep as a GREP_POST_TARGET_INSTALL_HOOK.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v2 1/1 package/grep: fix busybox aliasing

In reply to Angelo Compagnucci
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Angelo" == Angelo Compagnucci <[email protected]> writes:

When grep package is selected, it should be installed at the same exact location where busybox installs it too, this way the grep/egrep/fgrep executables will end up overwriting the busybox provided ones. Busybox installs *grep executables in /bin, grep package in /usr/bin.

Committed to 2019.02.x and 2019.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard