Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#62873 closed defect (fixed)

compiler_wrapper-1.0.tcl: spaces in arguments are lost

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: cjones051073,
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: mascguy (Christopher Nielsen)
Port: compiler_wrapper-1.0

Description

The compiler wrappers created by the compiler_wrapper-1.0.tcl portgroup do not preserve spaces in arguments passed to them nor in MACPORTS_LEGACY_SUPPORT_CPPFLAGS.

Here is what a compiler wrapper currently looks like:

#!/bin/bash
export CCACHE_DIR=/opt/local/var/macports/build/.ccache
CMD="/opt/local/bin/ccache /usr/bin/clang ${MACPORTS_LEGACY_SUPPORT_CPPFLAGS} -pipe   ${@} "
exec ${CMD}

To correct the problem, it needs to look like this:

#!/bin/bash
export CCACHE_DIR=/opt/local/var/macports/build/.ccache
exec /opt/local/bin/ccache /usr/bin/clang "$MACPORTS_LEGACY_SUPPORT_CPPFLAGS" -pipe "$@"

Preservation of spaces only occurs when the variable name is surrounded in quotation marks.

"$@" is a special case. $@ represents potentially multiple arguments and "$@" expands to each of the arguments individually surrounded with quotation marks.

Change History (2)

comment:1 Changed 3 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: assignedclosed

comment:2 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added
Note: See TracTickets for help on using tickets.