[MacPorts] Migration modified

MacPorts Wiki noreply at macports.org
Wed Oct 23 11:40:29 UTC 2019


Page "Migration" was changed by JDLH
Diff URL: <https://trac.macports.org/wiki/Migration?action=diff&version=113>
Revision 113
Comment: Add instructions on removing com.apple.quarantine and dealing with infinite loop from ports dependency cycle.
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: Migration
=========================================================================
--- Migration (version: 112)
+++ Migration (version: 113)
@@ -55,9 +55,11 @@
       {{{
       curl --location --remote-name https://github.com/macports/macports-contrib/raw/master/restore_ports/restore_ports.tcl
       chmod +x restore_ports.tcl
+      xattr -d com.apple.quarantine restore_ports.tcl
       sudo ./restore_ports.tcl myports.txt
       }}}
-      Note: ports that are not available on your new platform will be skipped without error.
+      Note: ports that are not available on your new platform will be skipped, with only a warning message. \\
+      Note: if you get an "Operation not permitted" error when running `restore_ports.tcl`, then `xattr -d com.apple.quarantine` will remove this obstacle. 
    a. (optional) Restore requested status:
       If you saved the list of requested ports, you can now restore the requested flags for your newly installed ports to their former states.
       {{{
@@ -76,6 +78,18 @@
 }}}
 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`. 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.
 
+If you see an "infinite loop" error message, such as this:
+{{{
+Error: we appear to be stuck, exiting...
+infinite loop
+    while executing
+"sort_ports $portList"
+    invoked from within
+"set operationList [sort_ports $portList]"
+    (file "./restore_ports.tcl" line 285)
+}}}
+it 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.
+
 If 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.
 
 Another potential problem is that the `restore_ports.tcl` command may fail with a `Too many open files` error message. Under macOS Sierra, the default shell has a default `ulimit` of 256 open files. The solution is to restore the ports with a slightly modified command:
@@ -83,3 +97,15 @@
 sudo bash -c "ulimit -n 4096; ./restore_ports.tcl myports.txt"
 }}}
 This will raise the file limit for the duration of the `restore_ports.tcl` command.
+
+If 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`.
+{{{
+% sudo ./restore_ports.tcl myports.txt
+sudo: unable to execute ./restore_ports.tcl: Operation not permitted
+% ls -l@ ./restore_ports.tcl
+-rwxr-xr-x@ 1 myuser  staff  9474 22 Oct 10:57 ./restore_ports.tcl
+	com.apple.quarantine	  21 
+% xattr -d com.apple.quarantine restore_ports.tcl
+% sudo ./restore_ports.tcl myports.txt
+[... script runs normally ...]
+}}}
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/Migration>
MacPorts <https://www.macports.org/>
Ports system for macOS

This is an automated message. Someone added your email address to be
notified of changes on 'Migration' page.
If it was not you, please report to admin at macports.org.


More information about the macports-changes mailing list