[MacPorts] #36957: Guide: Document the "subport" command

MacPorts noreply at macports.org
Sun Jul 11 21:12:09 UTC 2021


#36957: Guide: Document the "subport" command
--------------------------+--------------------------------
  Reporter:  dave@…       |      Owner:  macports-tickets@…
      Type:  enhancement  |     Status:  new
  Priority:  Normal       |  Milestone:
 Component:  guide        |    Version:
Resolution:               |   Keywords:
      Port:               |
--------------------------+--------------------------------

Comment (by JDLH):

 I think I found the code which implements the subport directive: macports-
 base/src/port1.0/portutil.tcl:844-857 [1]

 {{{
 # Portfiles may define more than one port.
 # This executes the given code in 'body' if we were opened as the
 specified
 # subport, and also adds it to the list of subports that are defined.
 proc subport {subname body} {
     global subport name PortInfo
     if {$subport eq $name && $subname ne $name &&
         (![info exists PortInfo(subports)] || $subname ni
 $PortInfo(subports))} {
         lappend PortInfo(subports) $subname
     }
     if {[string equal -nocase $subname $subport]} {
         set PortInfo(name) $subname
         uplevel 1 $body
     }
 }
 }}}

 That might be helpful to the person writing this documentation.

 [1] https://github.com/macports/macports-
 base/blob/2c6fc24ddd1d6961afa83c5b35be12224b6850f6/src/port1.0/portutil.tcl#L844-L857

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


More information about the macports-tickets mailing list