Opened 3 years ago

Closed 3 years ago

#64325 closed defect (fixed)

app PortGroup: app.icon unable to handle filenames with spaces

Reported by: jasonliu-- (Jason Liu) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: pg-app-1.0

Description

When using the app PortGroup, if you try to specify an .icns file with a space in the filename, it always tries to add port:makeicns as a dependency. I've tried multiple possible iterations of quoting a path/filename with spaces:

app.icon    "subdir/file with spaces.icns"
app.icon    "subdir/file\ with\ spaces.icns"
app.icon    {subdir/file with spaces.icns}
app.icon    {subdir/file\ with\ spaces.icns}

none of which are working. It looks like the problem may be somewhere inside proc app._icon_trace, although I'm not exactly sure what that problem could be.

Change History (4)

comment:1 Changed 3 years ago by jmroot (Joshua Root)

In 221b4643c787d16fe6352f20327f5bf2997ef1a2/macports-ports (master):

app pg: attempt to handle spaces in app.icon

See: #64325

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Try that. All options are lists, so some characters need to be quoted in them, one of which is spaces. Since this option is only expected to contain a single path, using join to flatten the list into a string should work fine. There was also some missing quoting in shell commands that would have caused problems with filenames containing spaces.

comment:3 in reply to:  2 Changed 3 years ago by jasonliu-- (Jason Liu)

Replying to jmroot:

Try that. All options are lists, so some characters need to be quoted in them, one of which is spaces. Since this option is only expected to contain a single path, using join to flatten the list into a string should work fine. There was also some missing quoting in shell commands that would have caused problems with filenames containing spaces.

It works, thanks Josh! Although I do agree with Ryan's comment in the GH commit, it's probably better to echo the values untransformed in the return -code error statements.

Last edited 3 years ago by jasonliu-- (Jason Liu) (previous) (diff)

comment:4 Changed 3 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.