Changes between Version 67 and Version 68 of Migration


Ignore:
Timestamp:
Oct 15, 2014, 12:53:19 PM (10 years ago)
Author:
jmroot (Joshua Root)
Comment:

promote restore_ports.tcl to the default method, and save the requested flags as part of the main instructions

Legend:

Unmodified
Added
Removed
Modified
  • Migration

    v67 v68  
    2222=== Reinstall MacPorts ===
    2323
    24 After updating the development tools such as Xcode and the Command Line Tools, [https://www.macports.org/install.php install the base MacPorts system] again, either from the appropriate pkg or dmg file if already available or [https://www.macports.org/guide/#installing.macports.source from source].
     24After updating the development tools, [https://www.macports.org/install.php install the base MacPorts system] for your new platform, either from the appropriate pkg or dmg file if already available or [https://www.macports.org/guide/#installing.macports.source from source].
    2525
    2626==== Update macports.conf ====
    2727
    28 If your macports.conf contains uncommented settings for universal_archs or build_arch, you will likely want to update them, since unlike earlier OS versions, the compiler on Snow Leopard will build for x86_64 by default on systems that support it. The default values will be fine for almost all users, so unless you know you need something different, just comment out these two lines.
     28If your macports.conf contains uncommented settings for universal_archs or build_arch, you will likely want to update them, since unlike earlier OS versions, the compiler on Snow Leopard and later will build for x86_64 by default on systems that support it. The default values will be fine for almost all users, so unless you know you need something different, just comment out these two lines.
    2929
    3030Several other settings in macports.conf have changed their defaults over the years. Take a moment to compare each line of your macports.conf with the corresponding line in macports.conf.default in the same directory. Unless you know a reason why a line your settings file should be different from the defaults, adopt the line from the defaults file.
     
    3838port -qv installed > myports.txt
    3939}}}
    40  2. Uninstall all installed ports:
     40 2. (optional) Save the list of requested ports:
     41{{{
     42port echo requested | cut -d ' ' -f 1 > requested.txt
     43}}}
     44 3. Uninstall all installed ports:
    4145{{{
    4246sudo port -f uninstall installed
    4347}}}
    44  3. Clean any partially-completed builds:
     48 4. Clean any partially-completed builds:
    4549{{{
    4650sudo port clean all
    4751}}}
    48  4. Browse `myports.txt` and install the ports that you actually want to use (as opposed to those that are only needed as dependencies) one by one, remembering to specify the appropriate variants:
    49 {{{
    50 sudo port install portname +variant1 +variant2 …
    51 }}}
    52 Note that if you have specified variants which are not the default, you may need to install ports in an order other than the alphabetical order recorded in `myports.txt`.
    53 
    54 ==== Automatically reinstall ports ==== #automatic
    55 
    56 A script has been written to automate Step 4 above, though it has some caveats. If it fails, you will just have to do it manually. (But see workaround for conflicting ports below.)
    57 
    58 To use it, you will first need to run steps 1-3 as described above. Then:
    59  4. Run these commands to download and execute the restore_ports script. (If you installed MacPorts from source and put its Tcl package somewhere other than /Library/Tcl, then you'll need to use the -t option when you run restore_ports.tcl; see `./restore_ports.tcl -h`.)
     52 5. Download and execute the restore_ports script. (If you installed MacPorts from source and put its Tcl package somewhere other than /Library/Tcl, then you'll need to use the -t option when you run restore_ports.tcl; see `./restore_ports.tcl -h`.)
    6053{{{
    6154curl -O https://svn.macports.org/repository/macports/contrib/restore_ports/restore_ports.tcl
     
    6356sudo ./restore_ports.tcl myports.txt
    6457}}}
    65 
    66 One known issue is that the script will fail if there are conflicting ports in the list. It's possible to have conflicting ports installed provided at most one of the conflicting set is active. If the script fails for this reason, you can delete one of the conflicting ports from myports.txt and then simply run the script again. You may need to do this multiple times if there are multiple conflicting ports listed.
    67 
    68 The requested status of the ports will also not be preserved, since it is not available to the script. You can restore it manually by doing something like this (where myport1, myport2 etc. are the ports you actually asked for):
     58 6. (optional) Restore requested status:
     59 If you saved the list of requested ports, you can now restore the requested flags for your newly installed ports to their former states.
    6960{{{
    7061sudo port unsetrequested installed
    71 sudo port setrequested myport1 myport2 …
     62< requested.txt xargs sudo port setrequested
    7263}}}
     64
     65==== Troubleshooting ====
     66
     67Though it is now quite well-tested, the restore_ports script may fail in some cases. One known issue is that the script will fail if there are conflicting ports in the list. It's possible to have conflicting ports installed provided at most one of the conflicting set is active. If the script fails for this reason, you can delete one of the conflicting ports from myports.txt and then simply run the script again. You may need to do this multiple times if there are multiple conflicting ports listed.
     68
     69In the worst case, you can reinstall your ports manually:
     70 5. Browse `myports.txt` and install the ports one by one, remembering to specify the appropriate variants:
     71{{{
     72sudo port install portname +variant1 +variant2 …
     73}}}
     74Note that if you have specified variants which are not the default, you may need to install ports in an order other than the alphabetical order recorded in `myports.txt`. You may skip explicitly installing ports that you did not request as long as they are not using non-default variants, since they will be installed as dependencies of other ports.