diff -r 84280fac98b9 -r 9170231ebf14 Doc/packaging/setupcfg.rst --- a/Doc/packaging/setupcfg.rst Tue Sep 27 07:30:00 2011 +0200 +++ b/Doc/packaging/setupcfg.rst Tue Sep 27 15:36:52 2011 -0400 @@ -764,8 +764,8 @@ /usr/include/blitz extra_compile_args = -fPIC -O2 - -DGECODE_VERSION=$(./gecode_version) -- sys.platform != 'win32' - /DGECODE_VERSION='win32' -- sys.platform == 'win32' + -DGECODE_VERSION=$(./gecode_version) ;; sys.platform != 'win32' + /DGECODE_VERSION='win32' ;; sys.platform == 'win32' The section name must start with ``extension:``; the right-hand part is used as the full name (including a parent package, if any) of the extension. Whitespace @@ -776,7 +776,7 @@ :class:`packaging.compiler.extension.Extension` class; values documented as Python lists translate to multi-line values in the configuration file. In addition, multi-line values accept environment markers on each line, after a -``--``. +``;;``. Command sections diff -r 84280fac98b9 -r 9170231ebf14 Lib/packaging/config.py --- a/Lib/packaging/config.py Tue Sep 27 07:30:00 2011 +0200 +++ b/Lib/packaging/config.py Tue Sep 27 15:36:52 2011 -0400 @@ -30,18 +30,20 @@ def _pop_values(values_dct, key): - """Remove values from the dictionary and convert them as a list""" + """Remove values from the dictionary and convert them to a list""" vals_str = values_dct.pop(key, '') if not vals_str: return fields = [] - # the line separator is \n for setup.cfg files - for field in vals_str.split('\n'): - tmp_vals = field.split('--') - if len(tmp_vals) == 2 and not interpret(tmp_vals[1]): - continue - fields.append(tmp_vals[0]) - # Get bash options like `gcc -print-file-name=libgcc.a` XXX bash options? + for field in vals_str.split("\n"): + if ';;' in field: + # fields values containing ';;' should add a trailing ';;' + # since this splits on the rightmost ';;' + field, marker = field.rsplit(';;', 1) + if not interpret(marker): + continue + fields.append(field) + # parse string into arglist using shlex POSIX rules vals = split(' '.join(fields)) if vals: return vals diff -r 84280fac98b9 -r 9170231ebf14 Lib/packaging/tests/test_config.py --- a/Lib/packaging/tests/test_config.py Tue Sep 27 07:30:00 2011 +0200 +++ b/Lib/packaging/tests/test_config.py Tue Sep 27 15:36:52 2011 -0400 @@ -111,8 +111,9 @@ sources = c_src/speed_coconuts.c extra_link_args = "`gcc -print-file-name=libgcc.a`" -shared define_macros = HAVE_CAIRO HAVE_GTK2 -libraries = gecodeint gecodekernel -- sys.platform != 'win32' - GecodeInt GecodeKernel -- sys.platform == 'win32' +libraries = + gecodeint gecodekernel ;; sys.platform != 'win32' + GecodeInt GecodeKernel ;; sys.platform == 'win32' [extension: two.fast_taunt] sources = cxx_src/utils_taunt.cxx @@ -120,8 +121,8 @@ include_dirs = /usr/include/gecode /usr/include/blitz extra_compile_args = -fPIC -O2 - -DGECODE_VERSION=$(./gecode_version) -- sys.platform != 'win32' - /DGECODE_VERSION='win32' -- sys.platform == 'win32' + -DGECODE_VERSION=$(./gecode_version) ;; sys.platform != 'win32' + /DGECODE_VERSION='win32' ;; sys.platform == 'win32' language = cxx # corner case: if the parent package of an extension is declared but