Skip to contentSkip to conversation

gzip: fix MakeMaker issues with using wrong SHELL/GREP

PATCH Superseded Ming Liu 1 participant 2 messages Nov 28, 2013 – Nov 29, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ming Liu

author
#0 lore raw

PATCH 1/1 gzip: fix MakeMaker issues with using wrong SHELL/GREP

Paths of shell/grep is being determined by detecting from host at configure stage, and then will be hard coded into scripts like zgrep, this would cause a following runtime error:
"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory"

Fixed by using runtime paths instead.

---
 meta/recipes-extended/gzip/gzip.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-extended/gzip/gzip.inc +5 -0
index 6ec1dae..4b265a6 100644
@@ -12,6 +12,11 @@ SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz"
 
 inherit autotools
 
+do_configure_prepend () {
+	sed '\#|/bin/sh|\$(SHELL)|#d' -i Makefile.am
+	sed 's#\(|\[@\]GREP@|\)\$(GREP)#\1/bin/grep#g' -i Makefile.am
+}
+
 do_install_append () {
 	# Rename and move files into /bin (FHS), which is typical place for gzip
 	install -d ${D}${base_bindir}
Signature · 1 line
1.8.4.1
author
#1 lore raw
Quoted 17 lines · Ming Liu

Paths of shell/grep is being determined by detecting from host at configure stage, and then will be hard coded into scripts like zgrep, this would cause a following runtime error:
"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory"

Fixed by using runtime paths instead.

---
  meta/recipes-extended/gzip/gzip.inc | 5 +++++
  1 file changed, 5 insertions(+)
meta/recipes-extended/gzip/gzip.inc +0 -0
index 6ec1dae..4b265a6 100644

meta/recipes-extended/gzip/gzip.inc SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz" · line 17

Quoted 6 lines
meta/recipes-extended/gzip/gzip.inc +3 -0
@@ -12,6 +12,11 @@ SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz"
 
  inherit autotools
 
+do_configure_prepend () {
+	sed '\#|/bin/sh|\$(SHELL)|#d' -i Makefile.am
+	sed 's#\(|\[@\]GREP@|\)\$(GREP)#\1/bin/grep#g' -i Makefile.am

There is a hardcode /bin/grep here, should be removed, and I am told it's better to use patch instead of prepending to do_configure task, so I will send the V2 soon.

//Ming Liu

Quoted 5 lines
meta/recipes-extended/gzip/gzip.inc +2 -0
+}
+
  do_install_append () {
  	# Rename and move files into /bin (FHS), which is typical place for gzip
  	install -d ${D}${base_bindir}