Bug 894776 - mach doesn't properly handle spaces in mozconfig commands. r=gps

This commit is contained in:
Mike Hommey 2013-07-18 15:25:36 +09:00
parent bfc566cb33
commit 585c4df19d
2 changed files with 7 additions and 7 deletions

View File

@ -11,7 +11,7 @@ set -e
ac_add_options() {
local opt
for opt in $*; do
for opt; do
echo "------BEGIN_AC_OPTION"
echo $opt
echo "------END_AC_OPTION"
@ -19,7 +19,7 @@ ac_add_options() {
}
ac_add_app_options() {
local app opt
local app
app=$1
shift
echo "------BEGIN_AC_APP_OPTION"
@ -30,7 +30,7 @@ ac_add_app_options() {
mk_add_options() {
local opt
for opt in $*; do
for opt; do
echo "------BEGIN_MK_OPTION"
echo $opt
echo "------END_MK_OPTION"

View File

@ -171,13 +171,13 @@ class TestMozconfigLoader(unittest.TestCase):
with NamedTemporaryFile(mode='w') as mozconfig:
mozconfig.write('ac_add_options --enable-debug\n')
mozconfig.write('ac_add_options --disable-tests --enable-foo\n')
mozconfig.write('ac_add_options --foo="bar"\n')
mozconfig.write('ac_add_options --foo="bar baz"\n')
mozconfig.flush()
result = self.get_loader().read_mozconfig(mozconfig.name)
self.assertEqual(result['configure_args'], [
'--enable-debug', '--disable-tests', '--enable-foo',
'--foo=bar'])
'--foo=bar baz'])
def test_read_ac_options_substitution(self):
"""Ensure ac_add_options values are substituted."""
@ -213,14 +213,14 @@ class TestMozconfigLoader(unittest.TestCase):
with NamedTemporaryFile(mode='w') as mozconfig:
mozconfig.write('mk_add_options MOZ_OBJDIR=/foo/bar\n')
mozconfig.write('mk_add_options MOZ_MAKE_FLAGS=-j8\n')
mozconfig.write('mk_add_options FOO=BAR\n')
mozconfig.write('mk_add_options FOO="BAR BAZ"\n')
mozconfig.write('mk_add_options BIZ=1\n')
mozconfig.flush()
result = self.get_loader().read_mozconfig(mozconfig.name)
self.assertEqual(result['topobjdir'], '/foo/bar')
self.assertEqual(result['make_flags'], '-j8')
self.assertEqual(result['make_extra'], ['FOO=BAR', 'BIZ=1'])
self.assertEqual(result['make_extra'], ['FOO=BAR BAZ', 'BIZ=1'])
def test_read_moz_objdir_substitution(self):
"""Ensure @TOPSRCDIR@ substitution is recognized in MOZ_OBJDIR."""