[JAVA] /bin/sh portability issues in gen-classlist.sh.in
Paolo Bonzini
paolo.bonzini@lu.unisi.ch
Fri Jul 7 13:33:00 GMT 2006
> # Only include generated files once.
> ! if test ! "${top_builddir}" -ef "@top_srcdir@"; then
> echo "Adding generated files in builddir '${top_builddir}'."
> # Currently the only generated files are in gnu.*.
> (cd ${top_builddir}; @FIND@ gnu -follow -name '*.java' -print) |
> --- 55,61 ----
> done
>
> # Only include generated files once.
> ! if test `cd "${top_builddir}"; pwd` != `cd "@top_srcdir@"; pwd`; then
Might be a problem when directories have spaces in it (remember this
script is also used on Windows):
$ test `echo foo bar` != `echo foo bar`
bash: test: too many arguments
Unfortunately, "`...`" is unportable if the substituted command also
have quotes. But a=`foo` does not break words so you can do this, which
may also be marginally more readable:
abs_top_builddir=`cd "${top_builddir}"; pwd`
abs_top_srcdir=`cd "@top_srcdir@"; pwd`
if test "$abs_top_builddir" != "$abs_top_srcdir"; then
...
Paolo
More information about the Java-patches
mailing list