[MacPorts] #61083: port info --depends repeats lines when more than one port specified

MacPorts noreply at macports.org
Sat Aug 29 05:55:24 UTC 2020


#61083: port info --depends repeats lines when more than one port specified
-------------------------+--------------------
  Reporter:  ryandesign  |      Owner:  (none)
      Type:  defect      |     Status:  new
  Priority:  Normal      |  Milestone:
 Component:  base        |    Version:  2.6.99
Resolution:              |   Keywords:
      Port:              |
-------------------------+--------------------

Comment (by ryandesign):

 The relevant code is in src/port/port.tcl in the proc `action_info` where
 it says:

 {{{
         # Interpret a convenient field abbreviation
         if {[info exists options(ports_info_depends)] &&
 $options(ports_info_depends) eq "yes"} {
             array unset options ports_info_depends
             set all_depends_options [list ports_info_depends_fetch
 ports_info_depends_extract \
                 ports_info_depends_patch ports_info_depends_build
 ports_info_depends_lib \
                 ports_info_depends_run ports_info_depends_test]
             foreach depends_option $all_depends_options {
                 set options($depends_option) yes
             }
             # insert the expanded options into the ordering info
             set order_pos [lsearch -exact
 $global_options(options_${action}_order) ports_info_depends]
             set global_options(options_${action}_order) [lreplace
 $global_options(options_${action}_order) \
                 $order_pos $order_pos {*}$all_depends_options]
         }
 }}}

 This is inside a loop over each port. It looks like the intention is that
 this only be executed for the first port, since the first thing it does is
 to unset `options(ports_info_depends)`. However, every time through the
 loop, `options` appears to have been reset to its previous value. I don't
 know where or how `options` gets set. Is that what's happening in
 src/macports1.0/macports.tcl in proc `mportinit` where it says:

 {{{
     ditem_key $mport options $options
 }}}

 It seems like there is a lot of code (creating the arrays list_map,
 pretty_label, pretty_wrap) that could be brought out of the foreachport
 loop.

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


More information about the macports-tickets mailing list