ports/132615: [patch] x11/libX11: work aroung parsing bug in Bash 4.0

Eygene Ryabinkin rea-fbsd at codelabs.ru
Fri Mar 13 15:50:04 PDT 2009


>Number:         132615
>Category:       ports
>Synopsis:       [patch] x11/libX11: work aroung parsing bug in Bash 4.0
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 13 22:50:03 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 7.1-STABLE amd64
>Organization:
Code Labs
>Environment:

System: FreeBSD 7.1-STABLE amd64

>Description:

Bash 4.0 (up to patchlevel 10, the freshest one) isn't able to correctly
parse the '$(...)' construct -- it chokes on the last ')' symbol.  Since
libX11's "doltcompile" script uses this construct, users with Bash 4.0
from ports won't be able to build libX11 port.

>How-To-Repeat:

Install fresh bash 4.x using shells/bash and try to build the x11/libX11
port.  It will complain after the first usage of "doltcompile" script.

Another test is to run the simple test: bash -c 'echo $(echo test)'.
It will say about unexpected token ')'.

>Fix:

The following fix that just uses backticks in the place of '$(...)'
works for me and should work for others, since `` and $(...) are doing
the same thing and bash 4.x handles backticks properly.

--- work-around-bug-in-Bash-4.0.diff begins here ---
>From 3fd5259e646f3600168be5bd51991467882d879e Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Date: Sat, 14 Mar 2009 01:35:13 +0300

Bash 4.0 <= PL10 is not able to handle $(...) expansion well.
Here we use backticks instead and this gives us the same result,
at it should.

Signed-off-by: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
---
 x11/libX11/files/patch-bash-4.0-parent-bug |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 x11/libX11/files/patch-bash-4.0-parent-bug

diff --git a/x11/libX11/files/patch-bash-4.0-parent-bug b/x11/libX11/files/patch-bash-4.0-parent-bug
new file mode 100644
index 0000000..190fd7f
--- /dev/null
+++ b/x11/libX11/files/patch-bash-4.0-parent-bug
@@ -0,0 +1,17 @@
+This patch is for the Bash 4.0 bug: it can not handle $(...) construct
+well, so we should use backticks instead.  As of 4.0 PL10 the bug is
+there, but I will try to fix it and send the modifications upstream.
+-- 
+Eygene Ryabinkin, rea-fbsd at codelabs dot ru
+
+--- configure.orig	2009-03-14 01:32:03.000000000 +0300
++++ configure	2009-03-14 01:32:12.000000000 +0300
+@@ -20046,7 +20046,7 @@
+         cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+ libobjdir="${obj%$objbase}.libs"
+ if test ! -d "$libobjdir" ; then
+-    mkdir_out="$(mkdir "$libobjdir" 2>&1)"
++    mkdir_out="`mkdir "$libobjdir" 2>&1`"
+     mkdir_ret=$?
+     if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
+ 	echo "$mkdir_out" 1>&2
-- 
1.6.1
--- work-around-bug-in-Bash-4.0.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-x11 mailing list