You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Marcus Comstedt <ma...@mc.pp.se> on 2002/01/21 19:42:59 UTC
shellscript breakage
Howdy.
I spotted some bashisms in the testsuite:
* The bourne shell syntax for command expansion is `cmd`, not $(cmd)
* The equality operator for [ is =, not ==
(I noticed that somebody else spotted the second one as well, but this
patch is more complete since it fixes both.)
Patch:
Index: ./subversion/tests/clients/cmdline/xmltests/svn-test.sh
===================================================================
--- ./subversion/tests/clients/cmdline/xmltests/svn-test.sh
+++ ./subversion/tests/clients/cmdline/xmltests/svn-test.sh Mon Jan 21 20:23:08 2002
@@ -2,14 +2,14 @@
SVN_PROG=../../../../clients/cmdline/svn
XML_DIR=../../../xml
-if [ "x${1}" == "x" ]; then
- SVN_PROG=$(pwd)/${SVN_PROG}
+if [ "x${1}" = "x" ]; then
+ SVN_PROG=`pwd`/${SVN_PROG}
else
# argument passed by make when builddir != srcdir
SVN_PROG=${1}/${SVN_PROG}
fi
-if [ "x${2}" == "x" ]; then
- XML_DIR=$(pwd)/${XML_DIR}
+if [ "x${2}" = "x" ]; then
+ XML_DIR=`pwd`/${XML_DIR}
else
# argument passed by make when builddir != srcdir
XML_DIR=${2}/${XML_DIR}
Index: ./subversion/tests/clients/cmdline/xmltests/svn-test2.sh
===================================================================
--- ./subversion/tests/clients/cmdline/xmltests/svn-test2.sh
+++ ./subversion/tests/clients/cmdline/xmltests/svn-test2.sh Mon
Jan 21 20:22:44 2002
@@ -4,14 +4,14 @@
SVN_PROG=../../../../clients/cmdline/svn
XML_DIR=../../../xml
-if [ "x${1}" == "x" ]; then
- SVN_PROG=$(pwd)/${SVN_PROG}
+if [ "x${1}" = "x" ]; then
+ SVN_PROG=`pwd`/${SVN_PROG}
else
# argument passed by make when builddir != srcdir
SVN_PROG=${1}/${SVN_PROG}
fi
-if [ "x${2}" == "x" ]; then
- XML_DIR=$(pwd)/${XML_DIR}
+if [ "x${2}" = "x" ]; then
+ XML_DIR=`pwd`/${XML_DIR}
else
-if [ "x${2}" == "x" ]; then
- XML_DIR=$(pwd)/${XML_DIR}
+if [ "x${2}" = "x" ]; then
+ XML_DIR=`pwd`/${XML_DIR}
else
# argument passed by make when builddir != srcdir
XML_DIR=${2}/${XML_DIR}
Furthermore, the code in autogen.sh that's supposed to find libtool.m4
isn't very robust. In particular, it breaks if libtoolize is a
symlink placed somewhere else than in ${prefix}/bin (with ${prefix}
being the prefix for libtool). Here's a piece of replacement logic
which is just as ugly, but works a little better:
Index: ./autogen.sh
===================================================================
--- ./autogen.sh
+++ ./autogen.sh Mon Jan 21 20:36:21 2002
@@ -38,8 +38,8 @@
$libtoolize --copy --automake
-ltpath=`dirname $libtoolize`
-ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4
+ltaclocalpath=`(egrep '^[_a-z]*(prefix|dir)=' $libtoolize;echo 'echo "$aclocaldir"')|/bin/sh`
+ltfile=`cd $ltaclocalpath ; pwd`/libtool.m4
if [ ! -f $ltfile ]; then
echo "$ltfile not found"
// Marcus
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: shellscript breakage
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Mon, Jan 21, 2002 at 08:42:59PM +0100, Marcus Comstedt wrote:
>
> Howdy.
>
> I spotted some bashisms in the testsuite:
>
> * The bourne shell syntax for command expansion is `cmd`, not $(cmd)
> * The equality operator for [ is =, not ==
>
> (I noticed that somebody else spotted the second one as well, but this
> patch is more complete since it fixes both.)
doh! i committed my change before seeing the additional problem you
pointed out.
sorry, this fix should probably go in, along with changing things to
use 'test' instead of [ and so forth, but i'll leave that to someone
with a better understanding of portable shell scripting than me.
-garrett
--
garrett rooney Unix was not designed to stop you from
rooneg@electricjellyfish.net doing stupid things, because that would
http://electricjellyfish.net/ stop you from doing clever things.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: shellscript breakage
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Have the alleged Bashisms (or Bournisms) caused anyone a problem? If
so, it's important right now. If not, let's not worry about it.
-K
Philip Martin <ph...@codematters.co.uk> writes:
> > I spotted some bashisms in the testsuite:
> >
> > * The bourne shell syntax for command expansion is `cmd`, not $(cmd)
>
> I am no shell expert, but I don't think $(cmd) is a bashism, it's POSIX
> sh syntax. Is bourne preferred over POSIX?
>
> --
> Philip
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: shellscript breakage
Posted by Philip Martin <ph...@codematters.co.uk>.
Marcus Comstedt <ma...@mc.pp.se> writes:
> Howdy.
>
> I spotted some bashisms in the testsuite:
>
> * The bourne shell syntax for command expansion is `cmd`, not $(cmd)
I am no shell expert, but I don't think $(cmd) is a bashism, it's POSIX
sh syntax. Is bourne preferred over POSIX?
--
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org