Update port reinstallation instruction on wiki

Joshua Root jmr at macports.org
Mon Oct 2 07:13:40 UTC 2023


On 2/10/2023 10:36, Jimmy Yuen Ho Wong wrote:
> Currently, the Migration 
> <https://trac.macports.org/wiki/Migration#ports> guide on the wiki 
> denotes a 6-step process to restore ports after an upgrade, one of which 
> requires the user to download a script that hasn't worked properly for a 
> few years now (doesn't restore variants and ignore platform and arch).

I follow the Migration instructions on every major OS update to ensure 
that they still work. I haven't noticed any problems with 
restore_ports.tcl. It restores all requested variants, including in 
non-requested dependencies, as intended.

I don't know what you expect it to do with platform and arch 
information, but if there are any specific bugs, please file tickets.

> I 
> propose a much simpler instruction like so:
> 
>  3. *Reinstall your ports*
>      1. Save the list of installed ports:
> 
>         port echo requested | sed -E s/@[^\+]+//g > requested.txt
> 
>      2. Uninstall all installed ports:
> 
>         sudo port -f uninstall installed
> 
>      3. Run a regular clear out of your installation:
> 
>         sudo port reclaim
> 
>      4. Restore requested ports:
> 
>         sudo bash -c 'cat requested.txt | xargs port -v install'

This won't necessarily restore the variants of non-requested ports 
correctly, and will sometimes install the same port multiple times (a 
requested port that is a dep of another requested port can be first 
installed with its default variants, then again with its previously 
requested variants.)

Ultimately the goal is to develop the 'port migrate' action to a state 
where it handles all of these considerations automatically. 
<https://trac.macports.org/ticket/56019>

- Josh


More information about the macports-dev mailing list