Opened 17 years ago

Closed 16 years ago

Last modified 14 years ago

#13031 closed defect (fixed)

port installed should list versions in natural order

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.6.0
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), afb@…
Port:

Description

"port installed" seems to list software versions in ASCII order instead of natural order.

A reproduction recipe follows, but you'll need Subversion installed, and your ports tree must be a Subversion working copy instead of an rsync directory.

If you don't already have apr 1.2.11 installed, install it:

$ svn up -r 28770 `port dir apr`
$ sudo port install apr

If you don't already have apr 1.2.8 and 1.2.9 installed, install them:

$ sudo -s
Password:
$ cd /opt/local/var/macports/distfiles/apr
$ curl -O http://archive.apache.org/dist/apr/apr-1.2.8.tar.bz2
$ svn up -r 22846 `port dir apr`
$ port install apr
$ curl -O http://archive.apache.org/dist/apr/apr-1.2.9.tar.bz2
$ svn up -r 26846 `port dir apr`
$ port install apr

It'll complain about already-installed versions. Nevermind that. Now see the list of installed versions of apr:

$ port installed apr
The following ports are currently installed:
  apr @1.2.11_0 (active)
  apr @1.2.8_0
  apr @1.2.9_0
$

It would be better if these were listed in natural order, e.g. with 1.2.11 coming after 1.2.9.

Attachments (1)

macports-portsort.patch (883 bytes) - added by afb@… 17 years ago.
macports-portsort.patch

Download all attachments as: .zip

Change History (9)

Changed 17 years ago by afb@…

Attachment: macports-portsort.patch added

macports-portsort.patch

comment:1 Changed 17 years ago by afb@…

Patch attached to sort in NVR (name@version_revision) order

comment:2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: afb@… added

Thanks for being so quick on this! Your code looks great... but for some reason I've applied the patch to trunk and rebuilt port but it's not doing anything different. I tried inserting ui_debug and ui_msg statements into the portlist_compare function to see what it's doing but they're not getting printed either. Any ideas?

comment:3 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Oh, I see now, portlist_compare is only called for port list but I'm not using port list; I'm using port installed... How do we apply this fix for port installed?

comment:4 Changed 16 years ago by afb@…

Hmm, maybe that calls a different sort/order function (or doesn't sort at all)

comment:5 Changed 16 years ago by jmpp@…

Component: portsbase

comment:6 Changed 16 years ago by afb@…

Resolution: fixed
Status: newclosed

Fixed, r32721.

Resorted the results from "port installed", to make sure it was printed sorted.

comment:7 Changed 15 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

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

Milestone: MacPorts FutureMacPorts 1.7.0
Note: See TracTickets for help on using tickets.