[MacPorts] #25823: muniversal fails when filename contains chars special to the shell, like parens
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Installing cairo-devel @1.9.14_0+universal fails because it installs a file whose name contains parentheses and muniversal doesn't properly escape filenames when running shell programs. {{{ [snip] DEBUG: universal: merge: merging /opt/local/share/gtk-doc/html/cairo /cairo-Quartz-(CGFont)-Fonts.html from /opt/local/var/macports/build /_Users_rschmidt_macports_dports_graphics_cairo-devel/work/destroot-i386 and /opt/local/var/macports/build /_Users_rschmidt_macports_dports_graphics_cairo-devel/work/destroot-x86_64 sh: -c: line 0: syntax error near unexpected token `(' [snip] }}} -- Ticket URL: <http://trac.macports.org/ticket/25823> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by ryandesign@…): In r70019 I simply enclosed filenames in quotes when passing them to shell programs. But this means now muniversal will fail for files whose names contain quotes. There must be some procedure that we can call that properly escapes ''all'' characters... -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by jmr@…): What's wrong with using single quotes? -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by ryandesign@…): Doesn't that then break any files whose names contain single quotes? -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by dluke@…): Maybe switch to exec instead of system? -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by ryandesign@…): I've wondered about that before. Why do we ever use system anywhere, and don't just use exec all the time, since it has this built-in escaping property, plus the ability to return the output? -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by dluke@…): I would guess it's mostly people don't know exec exists, or don't think about the problems that system makes you deal with, or start out quickly testing something with system and when it works don't think about making it work better ... -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by ryandesign@…): Is there anything at all that `system` is better at? If not, perhaps we should deprecate and eventually remove it, like we did already with `cd` and `exit`. -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by dluke@…): I think system doesn't redirect the command's STDOUT (so you could potentially see the progress as the command is being run) and since it does shell expansion and returns the return code of the program it might be easier to use in some situations. I can't really think of a reason to use it over exec, though - but I'm not really a tcl expert of any kind. -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by jmr@…): There would be no build output in the logs if we used exec for everything. Probably you want to string map " to \" in addition to enclosing in double quotes. -- Ticket URL: <http://trac.macports.org/ticket/25823#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25823: muniversal fails when filename contains chars special to the shell, like parens -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: -------------------------------------+-------------------------------------- Comment(by ryandesign@…): Replying to [comment:1 ryandesign@…]:
In r70019 I simply enclosed filenames in quotes when passing them to shell programs. I also enclosed the diffFormat argument in quotes, which was an error and caused #25991.
-- Ticket URL: <http://trac.macports.org/ticket/25823#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts