[MacPorts] #64326: app PortGroup: app.name unable to handle names with spaces

MacPorts noreply at macports.org
Mon Jan 3 01:10:46 UTC 2022


#64326: app PortGroup: app.name unable to handle names with spaces
-------------------------+--------------------
  Reporter:  jasonliu--  |      Owner:  (none)
      Type:  defect      |     Status:  new
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.7.1
Resolution:              |   Keywords:
      Port:  pg-app-1.0  |
-------------------------+--------------------

Comment (by jasonliu--):

 Replying to [comment:6 ryandesign]:
 > Replying to [comment:5 jasonliu--]:
 > > Replying to [comment:4 ryandesign]:
 > > > It was not anticipated that anyone would have a need to use a
 separate variable here. Why do you?
 > >
 > > Really? I'm a bit surprised that no one has encountered the following
 situation when writing a portfile:
 > >
 > > {{{
 > > name            shortname
 > > set pretty_name "Long Name with Capitalization and Spaces"
 > >
 > > app.name        $pretty_name
 > > app.executable  ${name}
 > > }}}
 >
 > Again: why do you want to create two variables when one is sufficient?
 >
 > {{{
 > name            shortname
 > app.name        Long Name with Capitalization and Spaces
 > }}}
 >
 > The default for `app.executable` is `$name` so most times you don't need
 to override it either. Please read the extensive comments I left in the
 app portgroup explaining how it is intended to be used.

 I never created two variables, at least not intentionally. Particularly if
 a port has multiple subports, only one of which uses the app PortGroup,
 defining {{{$pretty_name}}} near the top of the file allows it to be used
 in all of the subports, including the ones that don't use the app
 PortGroup. A more complete example than the snippet I provided would have
 been:

 {{{
 name                short name
 set pretty_name     "Long Name with Capitalization and Spaces"

 long_description    $pretty_name is a blah blah blah...

 if {$subport eq "${name}-auxiliary"} {
     # Other code that uses $pretty_name
 }

 patchfiles ...
 post-patch {
     ...
 }

 configure.args-append ...

 if {$subport eq ${name}} {
     PortGroup app 1.0

     app.name  $pretty_name
     app.icon  ...
 }
 post-destroot {
     ...
 }

 }}}

 And yes, including the {{{app.executable $name}}} in the example snippet
 was unnecessary, but that's not what this ticket is about anyway.

-- 
Ticket URL: <https://trac.macports.org/ticket/64326#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list