Opened 17 years ago

Closed 14 years ago

#13673 closed defect (fixed)

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

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.0.0
Component: base Version: 1.7.0
Keywords: Cc: lperry (Perry Lee)
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 (1)

maintainers.php (1.9 KB) - added by ryandesign (Ryan Carsten Schmidt) 17 years ago.
print list of all port maintainers

Download all attachments as: .zip

Change History (7)

comment:1 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

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

Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: maintainers.php added

print list of all port maintainers

comment:2 Changed 16 years ago by lperry (Perry Lee)

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.

comment:3 Changed 16 years ago by lperry (Perry Lee)

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.

comment:4 Changed 16 years ago by lperry (Perry Lee)

`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?

comment:5 Changed 16 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:6 Changed 14 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.0.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.