| Summary: | Missing quotes in autotools-utils_src_configure() | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Martin von Gagern <Martin.vGagern> |
| Component: | Eclasses | Assignee: | Maciej Mrozowski <reavertm> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | handgranaten-herbert, mgorny |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| URL: | http://sources.gentoo.org/eclass/autotools-utils.eclass | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
$ mytest=("foo bar") ; test=(${mytest[@]}) ; func(){ echo ${test[@]}; }; func;
foo bar
Why do you think assignment needs quoting? It doesn't. Proof me wrong.
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
(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}; (In reply to comment #1) > Proof me wrong. $ mytest=("foo bar") ; test=(${mytest[@]}) $ for itm in "${test[@]}"; do echo "${itm}"; done foo bar 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. 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! |
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.