Changes between Version 112 and Version 113 of Migration


Ignore:
Timestamp:
Oct 23, 2019, 11:40:24 AM (3 weeks ago)
Author:
JDLH (Jim DeLaHunt)
Comment:

Add instructions on removing com.apple.quarantine and dealing with infinite loop from ports dependency cycle.

Legend:

Unmodified
Added
Removed
Modified
  • Migration

    v112 v113  
    5656      curl --location --remote-name https://github.com/macports/macports-contrib/raw/master/restore_ports/restore_ports.tcl
    5757      chmod +x restore_ports.tcl
     58      xattr -d com.apple.quarantine restore_ports.tcl
    5859      sudo ./restore_ports.tcl myports.txt
    5960      }}}
    60       Note: ports that are not available on your new platform will be skipped without error.
     61      Note: ports that are not available on your new platform will be skipped, with only a warning message. \\
     62      Note: if you get an "Operation not permitted" error when running `restore_ports.tcl`, then `xattr -d com.apple.quarantine` will remove this obstacle.
    6163   a. (optional) Restore requested status:
    6264      If you saved the list of requested ports, you can now restore the requested flags for your newly installed ports to their former states.
     
    7779Note 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.
    7880
     81If you see an "infinite loop" error message, such as this:
     82{{{
     83Error: we appear to be stuck, exiting...
     84infinite loop
     85    while executing
     86"sort_ports $portList"
     87    invoked from within
     88"set operationList [sort_ports $portList]"
     89    (file "./restore_ports.tcl" line 285)
     90}}}
     91it indicates that the script has a list of ports to install, and it can't figure out which of the ports to install next. Each port has some obstacle that prevents it from being the next to install. One cause of this problem is a "dependency cycle": port A depends directly or indirectly on port B, while port B depends on port A.  A workaround is to reduce your list of ports to install, until it no longer has a dependency cycle.
     92
    7993If things go really wrong, don't forget that you can always [https://guide.macports.org/chunked/installing.macports.uninstalling.html uninstall MacPorts] entirely before manually reinstalling ports.
    8094
     
    8498}}}
    8599This will raise the file limit for the duration of the `restore_ports.tcl` command.
     100
     101If you attempt to run the `./restore_ports.tcl` script, and the shell gives you an "Operation not permitted" error, then the problem may be that macOS marked the script file as "quarantined". macOS does this for executable files downloaded from the internet. There are various ways to remove this quarantine, but `xattr -d` is one simple way. Another is to open `./restore_ports.tcl` with a text editor, and save it with a different filename, `./restore_ports2.tcl`.
     102{{{
     103% sudo ./restore_ports.tcl myports.txt
     104sudo: unable to execute ./restore_ports.tcl: Operation not permitted
     105% ls -l@ ./restore_ports.tcl
     106-rwxr-xr-x@ 1 myuser  staff  9474 22 Oct 10:57 ./restore_ports.tcl
     107        com.apple.quarantine      21
     108% xattr -d com.apple.quarantine restore_ports.tcl
     109% sudo ./restore_ports.tcl myports.txt
     110[... script runs normally ...]
     111}}}