Transferring ports via USB drive using fetch

Ryan Schmidt ryandesign at macports.org
Sat Jan 7 14:41:16 PST 2012


On Jan 7, 2012, at 15:32, João Pedro Jericó de Andrade wrote:

> I'm buying a new computer while travelling and would like to install MacPorts on it. Because internet connections in hotels are usually unreliable, I would like to know if I can take the ports on my current Mac through an external drive. I don't need to precompile them because time / space is not a constraint, only internet connection, so what I was thinking of doing is copying my distfiles from /opt/var/macports/distfiles/ and just pasting them in this directory in the new computer. I then just sudo port install them all and hopefully the fetch phase will be skipped and the ports will be installed just as it would if I had downloaded them.
> 
> Is my thinking correct? Would this work?

Yes, that's a good idea.

Note that every time you try to install a port, MacPorts will try to fetch and use a pre-compiled binary, instead of building from local distfiles. If we have a binary (currently only Snow Leopard x86_64 non-universal, and not all ports), this could take some time to download; if we don't have a binary, it'll still take some time to determine that. You can prevent the (attempted) use of a pre-compiled binary if desired by using the "-s" switch whenever you install, e.g.:

sudo port -s install foo

Alternately, you might be able to copy and use the pre-compiled binaries from your other computer. They are in /opt/local/var/macports/software. The processor architecture, build_arch, universal_archs (if you're building universal), and OS version (and, just to be sure, the Xcode version) of both computers would have to match. And if you built MacPorts from source, then the --prefix, --with-applications-dir, --with-frameworks-dir, --with-install-user and --with-install-group must also match.



More information about the macports-users mailing list