Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 339227 - Missing quotes in autotools-utils_src_configure()
Summary: Missing quotes in autotools-utils_src_configure()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal
Assignee: Maciej Mrozowski
URL: http://sources.gentoo.org/eclass/auto...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-30 08:34 UTC by Martin von Gagern
Modified: 2010-10-03 19:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2010-09-30 08:34:23 UTC
File autotools-utils.eclass function autotools-utils_src_configure() contains this line:

econfargs+=(${myeconfargs[@]})

The array elements should be quoted instead:

econfargs+=("${myeconfargs[@]}")

Otherwise elements of myeconfargs that contain spaces will be split, making it almost impossible to pass such arguments to configure.
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2010-09-30 09:03:31 UTC
$ mytest=("foo bar") ; test=(${mytest[@]}) ; func(){ echo ${test[@]}; }; func;
foo bar

Why do you think assignment needs quoting? It doesn't. Proof me wrong.
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2010-09-30 09:07:18 UTC
Even my first example had overquoting, here's one without due to arrays:

$ mytest=(foo bar) ; test=(${mytest[@]}) ; func(){ echo ${test[@]}; }; func;
foo bar

But this will of course bail out:

mytest=foo bar ; test=(${mytest}) ; func(){ echo ${test[@]}; }; func;
bash: bar: command not found
foo
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-09-30 09:08:37 UTC
(In reply to comment #1)
> $ mytest=("foo bar") ; test=(${mytest[@]}) ; func(){ echo ${test[@]}; }; func;
> foo bar
> 
> Why do you think assignment needs quoting? It doesn't. Proof me wrong.

You rather should used something like:
set -- ${test[@]}; echo ${1};
Comment 4 Martin von Gagern 2010-09-30 09:09:28 UTC
(In reply to comment #1)
> Proof me wrong.

$ mytest=("foo bar") ; test=(${mytest[@]})
$ for itm in "${test[@]}"; do echo "${itm}"; done
foo
bar
Comment 5 Maciej Mrozowski gentoo-dev 2010-09-30 20:13:59 UTC
Due to hardware failure, I'm temporarily out of gentoo-x86 access (and therefore even unable to set away status - where is this web interface for away status anyway?). So some patience is welcome.
Comment 6 Maciej Mrozowski gentoo-dev 2010-10-03 19:31:26 UTC
Indeed, following configure script:
<configure>
#!/bin/sh

echo 'Configure switches:'
for v in "$@"; do
	echo "$v"
done
</configure>

when called from:
<src_configure>
	local myeconfargs=(
		--with-foo-dir="/opt/foo /1.0/sdk"
		"--enable-bars A B C D E F"
	)
	autotools-utils_src_configure
</src_configure>

currently produces:
Configure switches:
--prefix=/usr
--build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu
--mandir=/usr/share/man
--infodir=/usr/share/info
--datadir=/usr/share
--sysconfdir=/etc
--localstatedir=/var/lib
--libdir=/usr/lib64
--disable-debug
--enable-shared
--disable-static
--with-foo-dir=/opt/foo
/1.0/sdk
--enable-bars
A
B
C
D
E
F

Fixed. Thanks for reporting!