Bug 16299

Summary: cairo tests assume /bin/sh is bash
Product: cairo Reporter: Michael <mjbauer>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.6.4   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:

Description Michael 2008-06-10 12:55:01 UTC
Several of the test scripts for cairo appear to assume that /bin/sh is actually bash.  This breaks on Solaris systems (I have verified this on Sol9 and Sol10, and do not know of any release of Solaris which had bash as /bin/sh), which are much more ksh-like.  I am told that Ubuntu's /bin/sh is also not bash, but I do not have a Ubuntu box to verify this on.

At least the following scripts all invoke /bin/sh with bash syntax:
* src/check-def.sh
* src/check-plt.sh
* src/check-headers.sh
* src/check-doc-syntax.sh
* doc/public/check-doc-coverage.sh

MJB
Comment 1 Behdad Esfahbod 2008-06-11 16:48:16 UTC
Can you tell me which parts of those scripts is bash-specific?
Comment 2 Michael 2008-06-12 12:04:26 UTC
bugzilla-daemon@freedesktop.org wrote:
> http://bugs.freedesktop.org/show_bug.cgi?id=16299
>
> --- Comment #1 from Behdad Esfahbod <freedesktop@behdad.org>  2008-06-11 16:48:16 PST ---
> Can you tell me which parts of those scripts is bash-specific?
>
>   
Any instance of ! in an if will not work in sh.

For example (from cairo-1.6.4/src/check-dev.sh):

    if ! which nm 2>/dev/null >/dev/null; then

does not work in Solaris stock /bin/sh, but it will in bash.

That's the first bash-ism I came across in any of the scripts when 
trying to run the test suite; there are likely more.  I did not further 
explore; I just changed the #! invocation from /bin/sh to 
/usr/local/bin/bash on all of them.

MJB
Comment 3 Behdad Esfahbod 2008-06-12 18:04:32 UTC
I removed the "!"s and fixed some other issues.  The scripts run happily with bash, dash, ksh, and zsh now.  If there are any other specific issues, let me know and I'll fix it.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.