New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #13673 (closed defect: fixed)

Opened 4 years ago

Last modified 9 months ago

port info --index does not work with 'current' pseudo-port

Reported by: ryandesign@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.0.0
Component: base Version: 1.7.0
Keywords: Cc: perry@…
Port:

Description

I want to get the list of all port maintainers. That should be doable like this:

port -q info --index --maintainer all | sed s/,//g | xargs -n 1 echo | sort | uniq

However, that doesn't work because

port -q info --index --maintainer all

prints the error message

Warning: port info --index does not work with 'current' pseudo-port

4400 times. (That's how many ports we have right now.)

Why this error message? I didn't ask for the 'current' pseudo-port; I asked for the 'all' pseudo-port.

I was able to get the list of all maintainers using

port echo all | xargs port -q info --index --maintainer | sed s/,//g | xargs -n 1 echo | sort | uniq

but this is not optimal; it took 9 minutes to run. All the information is in the PortIndex; it should just be able to open the single file, parse the 8800 lines to find all the maintainers, and spit them out, and it shouldn't take that long to do it.

Attachments

maintainers.php Download (1.9 KB) - added by ryandesign@… 4 years ago.
print list of all port maintainers

Change History

Changed 4 years ago by ryandesign@…

I wrote a PHP script to list all the maintainers. It runs in under 2 seconds.

Changed 4 years ago by ryandesign@…

print list of all port maintainers

Changed 3 years ago by perry@…

  • cc perry@… added

Disclaimer: This is my first time looking at proc foreachport and proc action_info so I may be (completely) wrong ;).

The error message may be a little misleading; it's not returned because the 'current' pseudo-port is asked for, but because portinfo is unset.

The other pseudo-ports, such as installed, work because they pass a portlist that contains portspecs with *no* porturl set ($portspec(url) == ""). When no porturl is set, an if block in action_info is executed that uses mportsearch to return portinfo, an array that contains the associated information in PortIndex.

The all pseudo-port uses the proc get_all_ports to populate portlist with portspecs that contain a url key. As a result, the if block is never executed, and information from the PortIndex is not read.

Changed 3 years ago by perry@…

I removed the if statement checking if porturl eq "" and tested the command you listed:

port -q info --index --maintainer all

It now appears to work, although I don't think this is the permanent fix we want.

Changed 3 years ago by perry@…

`port -q info --index --maintainer all' now works, but it's still slow (r43519). Should the PortIndex only be accessed through mportsearch, or are there other methods that can be used that may be faster?

Changed 3 years ago by toby@…

  • milestone changed from MacPorts base bugs to MacPorts Future

Milestone MacPorts base bugs deleted

Changed 9 months ago by jmr@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from MacPorts Future to MacPorts 2.0.0
Note: See TracTickets for help on using tickets.