Versions in ports

Artur Szostak aszostak at partner.eso.org
Mon Sep 14 09:44:27 PDT 2015


>> Then why not protect all other upgrade operations with a -f | --force
>> flag, except when upgrading everything? It seems much too easy at the
>> moment to perform an upgrade operation that has a good chance of leading
>> to an inconsistent state.
>
> no it will not. A normal upgrade will first upgrade all the ports
> dependencies, as required, such that you end up with a consistent
> updated port. Only if you specifically disable this can you get into a mess.

I think you can still get into a mess in the following situation.
Assume you have the following ports:

A 1.0 depends on C 1.0
B 1.0 also depends on C 1.0

And their newer versions are not backwards compatible with C 1.0, thus:

A 2.0 depends on C 2.0
B 2.0 depends on C 2.0

If the following steps are followed we end up in an inconsistent state:
1) Initially we install A and B when the repository contains Portfiles for versions 1.0.
    sudo port install A
    sudo port install B
2) The Portfiles in the repository are all updated to versions 2.0 so we synchronise to see the new available versions.
    sudo port sync
3) We choose to upgrade port A.
    sudo port upgrade A
4) At this point we have: A 2.0, B 1.0, C 2.0. Which means that we just broke package B with the upgrade of A.

If you look at the sequence of commands run:
    sudo port install A
    sudo port install B
    sudo port sync
    sudo port upgrade A
one would not expect this to break some of the software, and yet it does.

Cheers

Artur


More information about the macports-users mailing list