Opened 8 years ago

Last modified 8 years ago

#51706 new enhancement

platform statement: support an else clause

Reported by: RJVB (René Bertin) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version:
Keywords: haspatch Cc: ci42
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

As discussed on the ML a short while ago:

This patch introduces support for an else clause in the platform statement. Typical use would a port that needs to distinguish between 2 OS versions that require mutually exclusive treatment in multiple locations. With an else clause means that can be done without duplicating platform statements and without resorting to if/else constructs with their less elegant syntax in the test expression.

I haven't tested this yet but it might actually be possible to chain the commands:

platform darwin 10 {
# older
} [else] platform darwin 11 {
# old
} else {
# younger
}

If this is considered acceptable for a future MacPorts base version I'd really like to request a temporary vector to provide the new syntax ASAP, for instance through a PortGroup file.

Attachments (2)

patch-platform-command.diff (1.5 KB) - added by RJVB (René Bertin) 8 years ago.
patch-platform-command.2.diff (2.0 KB) - added by RJVB (René Bertin) 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by RJVB (René Bertin)

Attachment: patch-platform-command.diff added

comment:1 Changed 8 years ago by ci42

Cc: ciserlohn@… added

Cc Me!

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

Description: modified (diff)
Keywords: haspatch added

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

Has duplicate #52971.

This change looks simple enough.

comment:4 Changed 8 years ago by RJVB (René Bertin)

Damn, I did submit it here. Sorry reviving another ticket.

Changed 6 years ago by RJVB (René Bertin)

Note: See TracTickets for help on using tickets.