Opened 17 years ago

Closed 10 years ago

Last modified 7 years ago

#12429 closed defect (fixed)

port cannot handle spaces in various variables

Reported by: nox@… Owned by: larryv (Lawrence Velázquez)
Priority: High Milestone: MacPorts 2.3.0
Component: base Version: 1.7.0
Keywords: Cc: sfiera@…, ryandesign (Ryan Carsten Schmidt), anddam (Andrea D'Amore), cooljeanius (Eric Gallager), jmpp@…
Port:

Description

Here is my code (taken from libsdl_gfx-framework):

worksrcdir      "${distname}/Other Builds"

post-extract {
    system "cd ${worksrcpath} && tar -xvzf OSX-PB.tgz"
}

port output:

--->  Extracting SDL_gfx-2.0.16.tar.gz
DEBUG: setting option extract.args to /opt/local/var/macports/distfiles/libsdl_gfx/SDL_gfx-2.0.16.tar.gz
DEBUG: Environment: 
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work" && gzip -dc /opt/local/var/macports/distfiles/libsdl_gfx/SDL_gfx-2.0.16.tar.gz | /usr/bin/gnutar --no-same-owner -xf -'
DEBUG: Executing proc-post-org.macports.extract-extract-0
sh: line 1: cd: /opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work/{SDL_gfx-2.0.16/Other: No such file or directory
Error: Target org.macports.extract returned: shell command "cd /opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work/{SDL_gfx-2.0.16/Other Builds} && tar -xvzf OSX-PB.tgz" returned error 1
Command output: sh: line 1: cd: /opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work/{SDL_gfx-2.0.16/Other: No such file or directory

Warning: the following items did not execute (for libsdl_gfx-framework): org.macports.extract
Error: Status 1 encountered during processing.

Attachments (1)

Portfile (134 bytes) - added by ryandesign (Ryan Carsten Schmidt) 15 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 17 years ago by sfiera@…

Cc: sfiera@… added

Can you confirm that this is a problem with port and not just your post-extract? From what I can tell, port is enquoting the dir correctly (portutil.c:222), whereas your system command is not (it should read system "cd \"${worksrcpath}\" && tar -xvzf OSX-PB.tgz")

comment:2 Changed 17 years ago by nox@…

Look at the error: the shell command is printed, double quotes or not, the path is /opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work/{SDL_gfx-2.0.16/Other Builds}. These curly brackets should not be here.

comment:3 Changed 17 years ago by sfiera@…

Ah, yes, I didn't read closely enough. I know this is going to sound weird, but what happens if you remove the double quotes from the worksrcdir option? If I recall, options are lists; SDL_gfx-2.0.16/Other Builds is a two-element list but {SDL_gfx-2.0.16/Other Builds} is a one-element list as you specified.

comment:4 Changed 17 years ago by nox@…

Without quotes, only the first list item is taken into account, and the path becomes work/SDL_gfx-2.0.16/Other

comment:5 Changed 17 years ago by nox@…

Cc: nox@macports.org,sfiera@macports.orgnox@macports.org, sfiera@macports.org
Summary: port cannot handle spaces in worksrcdirport cannot handle spaces in various variables

xcode.build.settings is also affected: The following code:

variant universal {
    xcode.build.settings-append "ARCHS=\"ppc i386\""
    xcode.destroot.settings     ${xcode.build.settings}
}

produces the following build.cmd:

xcodebuild  -target "SDL_gfx" -configuration Deployment build OBJROOT=build/ SYMROOT=build/ {ARCHS="ppc i386"}

I think this bug should be handled with High priority.

comment:6 Changed 17 years ago by nox@…

Priority: NormalHigh

xcode.project produces garbage too.

comment:7 Changed 16 years ago by nox@…

Cc: nox@… removed
Milestone: MacPorts base bugs
Resolution: invalid
Status: newclosed

Let's close this one. It's way too old and I don't even remember what I was talking about.

comment:8 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Milestone: MacPorts base bugs
Resolution: invalid
Status: closedreopened
Version: 1.7.0

It's still an issue with trunk @37836. I can still reproduce the problem in comment 5.

comment:9 Changed 15 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:10 Changed 15 years ago by giorgio_v@…

Is this bug still reproducible with the 1.8 release? I’ve tried to install the libsdl_gfx-framework but I haven’t seen any issue (but the portfile seems changed since the ticket was opened).

comment:11 in reply to:  10 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to giorgio_v@…:

Is this bug still reproducible with the 1.8 release?

Yes. Take this minimal portfile:

$ port fetch
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
Portfile changed since last build; discarding previous state.
--->  Computing dependencies for foo
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
--->  Fetching foo
Error: Target org.macports.fetch returned: /mp/var/macports/build/_private_tmp/work/{foo-1.0/Path with spaces}
Error: Status 1 encountered during processing.

There should not be curly brackets around the worksrcdir in the message.

Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: Portfile added

comment:12 Changed 13 years ago by anddam (Andrea D'Amore)

Cc: and.damore@… added

Cc Me!

comment:13 Changed 13 years ago by anddam (Andrea D'Amore)

It's still reproducible with 1.9, r73232.

comment:14 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:15 Changed 11 years ago by larryv (Lawrence Velázquez)

Owner: changed from macports-tickets@… to larryv@…
Status: reopenednew

comment:16 Changed 11 years ago by larryv (Lawrence Velázquez)

Status: newassigned

Fixed for worksrcdir in r108311.

% curl -O https://trac.macports.org/raw-attachment/ticket/12429/Portfile && port fetch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   134  100   134    0     0    265      0 --:--:-- --:--:-- --:--:--   265
Warning: MacPorts running without privileges. You may be unable to complete certain actions (e.g. install).
--->  Fetching distfiles for foo
Warning: Your DNS servers incorrectly claim to know the address of nonexistent hosts. This may cause checksum mismatches for some ports.
Error: org.macports.fetch for port foo returned: /Users/larryv/.macports/opt/local/var/macports/build/_Users_larryv_Projects_MacPorts/foo/work/foo-1.0/Path with spaces
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port foo failed
%

comment:17 Changed 10 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: assignedclosed

Closing this as fixed since the cited variable was fixed. If there are others that were missed, please open this again.

comment:18 Changed 9 years ago by jmpp@…

Cc: jmpp@… added

Cc Me!

comment:19 Changed 7 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.3.0
Note: See TracTickets for help on using tickets.