Opened 16 years ago

Closed 16 years ago

#14564 closed defect (invalid)

port -uR upgrade doesn't upgrade dependencies

Reported by: waltman-macports@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc:
Port:

Description

I ran "port sync; port outdated" and saw that libpng was out of date. The manpage for port(1) lists among its options:

-R also upgrade dependents (only for upgrading) -u uninstall non-active ports when upgrading and uninstalling

So I figured that running "port -uR upgrade libpng" would upgrade any packages that depend on libpng, and then remove the old copies. But instead of doing that, it just upgraded itself. Then it complained that it couldn't remove the old copy because aterm depended it it:

---> Unable to uninstall libpng 1.2.24_0+darwin_8, the following ports depend on it: ---> aterm Error: Uninstall libpng 1.2.24_0+darwin_8 failed: Please uninstall the ports that depend on libpng first.

That error message was repeated 6 times.

There seem to be several potential bugs here:

  • If aterm depends on a specific version of libpng, why wasn't it rebuilt?
  • If aterm doesn't need to be rebuilt (e.g. it can use either 1.2.24 or 1.2.25 via symlinks in /opt/local/lib), then why is it an error to unstall the old package?
  • Why was the error message repeated 6 times?

Change History (3)

comment:1 Changed 16 years ago by raimue (Rainer Müller)

-u can only be used in conjunction with -f at the moment.

Ports cannot depend on a specific version, they just depends on another port. Therefore every dependent would be upgrade. There is no way to tell if it is necessary.

No idea why it was printed 6 times.

comment:2 in reply to:  1 Changed 16 years ago by waltman-macports@…

Replying to raimue@macports.org:

-u can only be used in conjunction with -f at the moment.

Then it should say that on the manpage :)

Ports cannot depend on a specific version, they just depends on another port. Therefore every dependent would be upgrade. There is no way to tell if it is necessary.

Isn't that the whole point of -R? If not, then what does "also upgrade dependents" mean?

No idea why it was printed 6 times.

Yes, that's very odd.

comment:3 Changed 16 years ago by danielluke (Daniel J. Luke)

Resolution: invalid
Status: newclosed

-u can be used without -f, it's just not really useful unless you use it with -f.

-u should be avoided in general though. It's better to do the upgrade and then uninstall (with -f) the newly inactive ports.

-R will rebuild everything that depended on the new port, this is only actually necessary some of the time, but macports isn't yet smart enough to only do it if it's necessary. IIRC using -R with -f can cause multiple rebuilds which is annoying.

To address your original questions:

  1. No ports depend on specific versions of other ports. If you upgrade a library and its ABI changes anything that depended on that library will most likely have to be rebuilt (this is what -R is for). Frequently, though, library authors try to maintain ABI compatibility. For my personal usage, I use port -dvnf upgrade outdated and then manually fix things if necessary (or use -R if I know there is an ABI change).
  1. aterm didn't get rebuilt because things stopped after the uninstall error
  1. Without the actual output, it's difficult to determine why on your system the message was printed 6 times. The upgrade code isn't very long, though, so you could probably figure it out yourself if you were really curious.
Note: See TracTickets for help on using tickets.