#61083 closed defect (fixed)
port info --depends repeats lines when more than one port specified
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 2.6.4 |
Component: | base | Version: | 2.6.99 |
Keywords: | haspatch | Cc: | |
Port: |
Description
If port info --depends
is invoked on a single port, the output is fine:
$ port info --depends zlib depends_fetch: depends_extract: xz depends_patch: depends_build: depends_lib: depends_run: depends_test:
If info is requested for two ports, the first port's output is fine, but the second port's output is printed twice:
$ port info --depends zlib xz depends_fetch: depends_extract: xz depends_patch: depends_build: depends_lib: depends_run: depends_test: -- depends_fetch: depends_extract: lbzip2 depends_patch: depends_build: depends_lib: libiconv, gettext depends_run: depends_test: depends_fetch: depends_extract: lbzip2 depends_patch: depends_build: depends_lib: libiconv, gettext depends_run: depends_test:
With three ports, the second port's output is printed twice and the third port's output is printed three times:
$ port info --depends zlib xz libiconv depends_fetch: depends_extract: xz depends_patch: depends_build: depends_lib: depends_run: depends_test: -- depends_fetch: depends_extract: lbzip2 depends_patch: depends_build: depends_lib: libiconv, gettext depends_run: depends_test: depends_fetch: depends_extract: lbzip2 depends_patch: depends_build: depends_lib: libiconv, gettext depends_run: depends_test: -- depends_fetch: depends_extract: depends_patch: depends_build: gperf depends_lib: depends_run: depends_test: depends_fetch: depends_extract: depends_patch: depends_build: gperf depends_lib: depends_run: depends_test: depends_fetch: depends_extract: depends_patch: depends_build: gperf depends_lib: depends_run: depends_test:
Change History (5)
comment:1 follow-up: 2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Owner: | set to ryandesign |
---|---|
Status: | new → accepted |
Replying to ryandesign:
However, every time through the loop,
options
appears to have been reset to its previous value. I don't know where or howoptions
gets set. Is that what's happening in src/macports1.0/macports.tcl
Ah no, it's happening in src/port/port.tcl in proc foreachport
, and it's intentional.
So we need to check and only replace the option in global_options
if the old option was actually found there (i.e. if order_pos != -1
).
comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | haspatch added |
---|---|
Milestone: | → MacPorts 2.7.0 |
comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
comment:5 Changed 4 years ago by jmroot (Joshua Root)
Milestone: | MacPorts 2.7.0 → MacPorts 2.6.4 |
---|
The relevant code is in src/port/port.tcl in the proc
action_info
where it says: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 howoptions
gets set. Is that what's happening in src/macports1.0/macports.tcl in procmportinit
where it says: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.