[fdo-trac] #196: bash'isms in build_thirdparty.sh which uses /bin/sh
FDO
trac_fdo at osgeo.org
Thu Dec 13 13:05:20 EST 2007
#196: bash'isms in build_thirdparty.sh which uses /bin/sh
----------------------------+-----------------------------------------------
Reporter: warmerdam | Owner: gregboone
Type: defect | Status: new
Priority: minor | Milestone: 3.3.0
Component: Build System | Version: 3.2.0
Severity: 3 | Keywords: bash
External_id: |
----------------------------+-----------------------------------------------
When I build FDO from svn trunk (presumably analygous to 3.3) I get:
{{{
warmerda at gdal64[23]% ./build_thirdparty.sh
test: 152: ==: unexpected operator
test: 161: ==: unexpected operator
./build_thirdparty.sh: 168: Syntax error: Bad fd number
}}}
the problem turns out to be that on Ubuntu /bin/sh is now a pointer to
/bin/dash which is presumably a more bourne shell compatible interpreter
than /bin/bash. But the script uses "==" as an operator for test which I
gather is a bash extension.
The problem can be resolved by changing == to = or running the script with
/bin/bash instead of /bin/sh.
My suggestion is that we just modify the bang line for these scripts to
use /bin/bash, though cleaning them up to work with real bourne shells
should also be fairly straight forward. I'd be willing to take on the
implementation of either if so desired.
Note, bash is not normally available on some BSD derived systems, so in
some ways the sh compatability is better than just using bash.
I believe this problem affects other similar scripts like build_linux.sh.
Another work around is to change the /bin/sh pointer on my system to point
to bash but that may have unexpected consequences, and isn't a good
solution for the project.
--
Ticket URL: <http://trac.osgeo.org/fdo/ticket/196>
FDO <http://fdo.osgeo.org/>
Feature Data Objects
More information about the fdo-trac
mailing list