GNOME Bugzilla – Bug 550006
autogen.sh doesn't correctly handle quotes ", passing environment args fail
Last modified: 2009-11-01 14:41:12 UTC
I can't autogen.sh like this: ./autogen.sh -- --prefix CFLAGS="-g -O0" as autogen.sh and gst-autogen.sh doesn't handle quotes "" correctly.
Created attachment 117672 [details] [review] handle quotes correctly The problem was caused by common/gst-autogen.sh converts the command line arguments to a string CONFIGURE_EXT_OPT, but doesn't handle ". This patch, rather than converting to string, uses "$@". The patch still supports the '--' feature of autogen.sh, and --noconfigure, --nocheck, --debug, etc features of autogen.sh
I think it would be better to fix this: Index: autogen.sh =================================================================== RCS file: /cvs/gstreamer/gstreamer/autogen.sh,v retrieving revision 1.113 diff -u -r1.113 autogen.sh --- autogen.sh 10 Jan 2008 12:14:04 -0000 1.113 +++ autogen.sh 31 Aug 2008 03:57:44 -0000 @@ -27,7 +27,7 @@ CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-failing-tests --enable-poi -autogen_options $@ +autogen_options "$@" echo -n "+ check for build tools" if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi
Created attachment 117674 [details] [review] patch Ignore that, I see the problem now. Here's a less invasive patch.
Created attachment 117676 [details] [review] few typos Cool, you're patch fixes the problems, apart from a few typos: +while test "x$1" != "x" ; do should be +while test ! "x$1" = "x" ; do and don't do this bit, as it doesn't work: - if test ! -z "$CONFIGURE_EXT_OPT" + if test ! -z "$CONFIGURE_EXT_OPT $@"
Those aren't typos.
The following line resulted in an error on my system (Ubuntu intrepid): while test "x$1" != "x" ; do The following line resulted in an error on my system: if test ! -z "$CONFIGURE_EXT_OPT $@"
What value of $1 did it choke on?
with patch at attachment 117674 [details] [review] : using: ./autogen.sh -- --prefix /opt/gnome2 --libdir '${exec_prefix}/lib64' --disable-tests --disable-static --disable-gtk-doc CFLAGS="-g -O0" I get the error: test: 30: /opt/gnome2: unexpected operator
What shell (and version) are you using?
/bin/sh is dash. dash version 0.5.4-9ubuntu1.
Any progress or news on this?
Also apparently both patches don't work but IMHO David's patch should already be committed as is because it fixes at least some potential problems. David?
Should be flagged as WONTFIX, since this is impossible to do correctly without significant work, and the workarounds are trivial.
Resolving as WONTFIX as per David's comment. (If portability is a concern, one could just change autogen.sh to use /bin/bash instead... ;-))