Changes between Version 78 and Version 79 of Migration


Ignore:
Timestamp:
Dec 15, 2014, 2:12:00 AM (9 years ago)
Author:
dave@…
Comment:

The reinstall ports shell script is better as a function.

Legend:

Unmodified
Added
Removed
Modified
  • Migration

    v78 v79  
    2121   a. **Update macports.conf.** 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 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. Several 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.
    22221. [=#ports] **Reinstall ports.**
    23       {{{
     23    {{{
     24    # If there is an argument, then don't preserve 'requested' flags.
     25    function reinstallPorts() {
     26      dontPreserveRequestedFlags=$1
    2427      # Save the list of installed ports.
    2528      port -qv installed > myports.txt
    2629      # Preserve the requested flags (optional).
    27       PRESERVE_REQUESTED_FLAGS=true
    28       if [[ $PRESERVE_REQUESTED_FLAGS ]] ; then
     30      if [[ ! $dontPreserveRequestedFlags ]] ; then
    2931        port echo requested | cut -d ' ' -f 1 > requested.txt
    3032      fi
     
    3739      chmod +x restore_ports.tcl
    3840      # Change this if your installation is somewhere else.
     41      # (There should be a way to get the port command to report this.)
    3942      MACPORTS_HOME=/opt/local
    4043      # Execute the restore_ports script.
    4144      sudo ./restore_ports.tcl -p $MACPORTS_HOME myports.txt
    42       if [[ $PRESERVE_REQUESTED_FLAGS ]] ; then
     45      if [[ ! $dontPreserveRequestedFlags ]] ; then
    4346        sudo port unsetrequested installed
    4447        < requested.txt xargs sudo port setrequested
    4548      fi
    46       }}}
     49    }
     50    }}}
    4751
    4852=== Troubleshooting ===