[MacPorts] #23456: use_dmg yes fails when worksrcdir contains a space

MacPorts noreply at macports.org
Wed Apr 14 17:33:34 PDT 2010


#23456: use_dmg yes fails when worksrcdir contains a space
-------------------------------------+--------------------------------------
 Reporter:  ryandesign@…             |       Owner:  ryandesign@…           
     Type:  defect                   |      Status:  new                    
 Priority:  Normal                   |   Milestone:  MacPorts 1.8.3         
Component:  base                     |     Version:  1.8.2                  
 Keywords:                           |        Port:                         
-------------------------------------+--------------------------------------

Comment(by raimue@…):

 All options take lists as input. The problem is that Tcl splits the
 build.args in bzip2 in an unintended way.

 See this example in tclsh:
 {{{
 % foreach i {FOO="foo bar" baz} { puts $i }
 FOO="foo
 bar"
 baz
 % foreach i {FOO="foo bar" "baz"} { puts $i }
 FOO="foo
 bar"
 baz
 }}}

 Note that quotes around single list items are not preserved as they are
 only necessary to separate the list items. The code in `command_string`
 assembles a string from this format by converting each item to a string
 and then using string concatenation. List concatenation will not give the
 desired result.

 It is also not possible to pass quoted arguments from a Portfile as
 `handle_option` will silently remove the quotes at the time of assignment.
 You would have to escape the quotes in this case.

 Which leads to the solution to your initial problem. In order to pass the
 directories quoted, escape the quotes around such list items. I will
 attach a new patch which adds another level of backslashes.

-- 
Ticket URL: <http://trac.macports.org/ticket/23456#comment:3>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list