Skip to contentSkip to conversation

Allow use of dash as /bin/sh

PATCH In review Richard Purdie 2 participants 2 messages Nov 8, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow use of dash as /bin/sh

We've had the check for dash as /bin/sh for a long time. Dash has been around long enough now that most major issues have been identified and fixed from build perspective.

This patch fixes a bashism in the openjade-native recipe. It also adjusts libtool so that the header at the script is used and not the value of $SHELL. This is because many Makefiles change $SHELL so dash can get used to execute what is otherwise configured as a bash shell script. Since we don't need to execute scipts this way on any system I'm aware of us building upon, the simplest fix is just to remove $SHELL.

With these two changes the dash check can be removed and we can allow builds with dash as /bin/sh

[Note: I know I need to add the description of the libtool change above into the prefix.patch]
---

meta/classes/sanity.bbclass +0 -3
index 3f42b4f..838448f 100644
@@ -331,9 +331,6 @@ def check_sanity(e):
     if not data.getVar( 'DISPLAY', e.data, True ) and data.getVar( 'IMAGETEST', e.data, True ) == 'qemu':
         messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n'
 
-    if os.path.basename(os.readlink('/bin/sh')) == 'dash':
-        messages = messages + "Using dash as /bin/sh causes various subtle build problems, please use bash instead (e.g. 'dpkg-reconfigure dash' on an Ubuntu system.\n"
-
     omask = os.umask(022)
     if omask & 0755:
         messages = messages + "Please use a umask which allows a+rx and u+rwx\n"
meta/recipes-devtools/libtool/libtool/prefix.patch +1 -1
index 1b20324..7737990 100644
@@ -18,7 +18,7 @@ Index: libtool-2.4/libltdl/m4/libtool.m4
  
  # Always use our own libtool.
 -LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL='$(top_builddir)'
 +LIBTOOL="$LIBTOOL/${host_alias}-libtool"
  AC_SUBST(LIBTOOL)dnl
  
meta/recipes-devtools/openjade/openjade-native_1.3.2.bb +3 -1
index 6cc6bb5..0cce46e 100644
@@ -53,7 +53,9 @@ do_install() {
 
 	install -d ${D}${datadir}/sgml/openjade-${PV}
 	install -m 644 dsssl/catalog ${D}${datadir}/sgml/openjade-${PV}
-	install -m 644 dsssl/*.{dtd,dsl,sgm} ${D}${datadir}/sgml/openjade-${PV}
+	install -m 644 dsssl/*.dtd ${D}${datadir}/sgml/openjade-${PV}
+	install -m 644 dsssl/*.dsl ${D}${datadir}/sgml/openjade-${PV}
+	install -m 644 dsssl/*.sgm ${D}${datadir}/sgml/openjade-${PV}
 
 	install -d ${datadir}/sgml/openjade-${PV}
 	install -m 644 dsssl/catalog ${datadir}/sgml/openjade-${PV}/catalog
Reviewed-by on v1 1/1
#1 lore raw

Dear Richard,

Am Dienstag, den 08.11.2011, 21:33 +0000 schrieb Richard Purdie:

Quoted 9 lines

We've had the check for dash as /bin/sh for a long time. Dash has been around long enough now that most major issues have been identified and fixed from build perspective.

This patch fixes a bashism in the openjade-native recipe. It also adjusts libtool so that the header at the script is used and not the value of $SHELL. This is because many Makefiles change $SHELL so dash can get used to execute what is otherwise configured as a bash shell script. Since we don't need to execute scipts this way on any system I'm

sc*r*ipts

Quoted 4 lines

aware of us building upon, the simplest fix is just to remove $SHELL.

With these two changes the dash check can be removed and we can allow builds with dash as /bin/sh

Could also have been separate changes. But does not matter much.

Quoted 1 line
Quoted 3 lines

[Note: I know I need to add the description of the libtool change above into the prefix.patch]
---

[…]

Thanks,

Paul