port upgrade outdated from 2.0.2 to 2.0.3 messed up user database

Joshua Root jmr at macports.org
Fri Oct 14 20:24:09 PDT 2011


On 2011-10-15 13:20 , Ryan Schmidt wrote:
> On Oct 14, 2011, at 21:02, Daniel J. Luke wrote:
>> On Oct 14, 2011, at 9:46 PM, Ryan Schmidt wrote:
>>> But be sure you understand what the problem is. Prior to MacPorts 2.0.2, selfupdate did this:
>>>
>>> 1. The old version of MacPorts runs "sync" to download the new portfiles
>>> 2. The old MacPorts indexes those new ports
>>> 3. The old MacPorts downloads the code for the new version of MacPorts
>>> 4. The old MacPorts compiles the new MacPorts
>>> 5. The old MacPorts exits; any subsequent invocation of "port" will be the new version
>>>
>>> The order may not be completely correct but the point is that the problem is that the old MacPorts is not capable of correctly indexing the ports that were just downloaded, if the ports contain new syntax only understood by the new MacPorts. Therefore MacPorts 2.0.2 and up skips step 2 if a new version of MacPorts has been downloaded, and prints a message telling the user to run selfupdate again. When the user does so, it'll be the new version of MacPorts running that is capable of indexing the ports correctly.
>>>
>>> If you wanted to make this all work in a single selfupdate run, you'd have to have a way for the old MacPorts to launch the new MacPorts to do the indexing. That might be tricky.
>>
>> Why not, check for a new version of macports first, if found build/install new version than exec whatever version is (now) installed and have it run sync (and index what it sync'd)?
> 
> I'm assuming it would be the "exec whatever version is (now) installed" part that would be hard.
> 
> What you suggested was also my first suggestion in the ticket I filed about the problem, but Joshua implemented it the way it's currently implemented.
> 
> https://trac.macports.org/ticket/30739
> 
> Perhaps Joshua can comment further.

It's not particularly hard to exec the new portindex(1), it's just
unnecessary when there's already a perfectly good PortIndex we can sync
from the server. You don't get the message telling you to run selfupdate
again unless you are using a file:// source where the PortIndex has to
be generated locally.

- Josh


More information about the macports-users mailing list