If you are just looking to save some space at the expense of time, you could set:<br>
<br>
portarchivetype      txz<br>
<br>
in macports.conf; on some of the big clang/llvm archives this is ~2x improvement...<br>
<br>
On Wed, May 18, 2016 at 12:16 PM, Ryan Schmidt &lt;<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;ryandesign@macports.org&#39;)">ryandesign@macports.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; On May 17, 2016, at 5:38 PM, Nicolas Martin &lt;<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;nicolas.martin.3d@gmail.com&#39;)">nicolas.martin.3d@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On May 17, 2016, at 5:15 PM, Clemens Lang &lt;<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;cal@macports.org&#39;)">cal@macports.org</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Tue, May 17, 2016 at 10:58:56AM -0400, Nicolas Martin wrote:<br>
&gt;&gt;&gt;&gt; I have looked for real answers regarding this question through the<br>
&gt;&gt;&gt;&gt; mailing list, but did not really understand the purpose of these<br>
&gt;&gt;&gt;&gt; files.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; MacPorts always keeps a tarball of the files installed by a certain<br>
&gt;&gt;&gt; port in this directory. This allows you to switch between installed<br>
&gt;&gt;&gt; versions or between ports that would otherwise conflict without<br>
&gt;&gt;&gt; re-installing them completely. port activate/port deactivate implement<br>
&gt;&gt;&gt; this.<br>
&gt;&gt;<br>
&gt;&gt; Is there a way to have MacPorts behave so as to completely reinstall a port if one needs to ?<br>
&gt;<br>
&gt; Regarding switching between installed versions of a port: MacPorts does not have the capability to build an arbitrary version of a port, only the current version of a port. So if you might want to switch back to an older version, you should keep it installed. Otherwise you have to perform manual steps to rebuild the old version as described here:<br>
&gt;<br>
&gt; <a href="https://trac.macports.org/wiki/howto/InstallingOlderPort" target="_blank">https://trac.macports.org/wiki/howto/InstallingOlderPort</a><br>
&gt;<br>
&gt; Regarding switching between conflicting ports: If you don&#39;t want to keep both ports installed, for example for disk space reasons, you can of course uninstall one port and install the other. Then, to switch back, you can uninstall the second port and reinstall the first.<br>
&gt;<br>
&gt;<br>
&gt;&gt; I would prefer to wait through the process of building and activating the port again if I need to, than to lose quite a lot of space with duplicated binaries I almost never have to activate again.<br>
&gt;&gt;<br>
&gt;&gt;&gt; The rationale here is that after an update you can test the updated<br>
&gt;&gt;&gt; version of a software for a while, and if you notice it causes problems<br>
&gt;&gt;&gt; you can file a ticket and easily go back to the old version with a<br>
&gt;&gt;&gt; simple<br>
&gt;&gt;&gt; sudo port activate @oldversion<br>
&gt;&gt;<br>
&gt;&gt; I understand this, but if you never have to revert to an older version of a package, this is quite a waste of space.<br>
&gt;<br>
&gt; It&#39;s also not entirely uncommon for a user to discover that some of a port&#39;s files have vanished or been replaced with the wrong contents, for example by running a third-party installer that installed older files into the MacPorts prefix. Some of these types of problems can be resolved by deactivating and then reactivating the affected ports, which you couldn&#39;t do if you didn&#39;t have an archive there.<br>
&gt;<br>
&gt; The decision to store these archives on the disk was made with the assumption that disk space is cheap, and becoming cheaper. And while disk space is indeed getting cheaper, we didn&#39;t anticipate the rise of more-expensive-yet-smaller SSDs.<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; MacPorts used to keep these files in a directory and just hard-link them<br>
&gt;&gt;&gt; into $prefix, but that (a) means modifications to files in $prefix<br>
&gt;&gt;&gt; affect the supposed-to-be prinstine copy, and (b) isn&#39;t easy to download<br>
&gt;&gt;&gt; as pre-built binary. For this reason, we switched to tarballs a while<br>
&gt;&gt;&gt; back and now provide pre-built binaries for some of these tar balls.<br>
&gt;<br>
&gt; Another reason was that hard links didn&#39;t play nicely with Time Machine.<br>
&gt;<br>
&gt;<br>
&gt;&gt;&gt;&gt; I have almost 5Gb of archives (tbz2) in<br>
&gt;&gt;&gt;&gt; /opt/local/var/macports/software.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; You seem to have quite a few ports installed. My software directory is<br>
&gt;&gt;&gt; 3.4G with 652 installed ports.<br>
&gt;&gt;<br>
&gt;&gt; Well clang and llvm occupies a whooping 1.2G by themselves alone.<br>
&gt;<br>
&gt; True, clang and llvm are large. But according to<br>
&gt;<br>
&gt; <a href="https://packages.macports.org/llvm-3.7/?C=M;O=D" target="_blank">https://packages.macports.org/llvm-3.7/?C=M;O=D</a><br>
&gt;<br>
&gt; llvm-3.7 is 377MB and according to<br>
&gt;<br>
&gt; <a href="https://packages.macports.org/clang-3.7/?C=M;O=D" target="_blank">https://packages.macports.org/clang-3.7/?C=M;O=D</a><br>
&gt;<br>
&gt; clang-3.7 is 357MB. If you&#39;re seeing twice that size on your system, maybe you&#39;ve installed it with the universal variant.<br>
&gt;<br>
&gt;<br>
&gt;&gt;&gt;&gt; I have already run the port uninstall inactive command, so from my<br>
&gt;&gt;&gt;&gt; understanding, what remains in this path is from currently active and<br>
&gt;&gt;&gt;&gt; used ports.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Correct.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; What I don’t understand, and does not seem to be clear from any posts<br>
&gt;&gt;&gt;&gt; I have read regarding the matter, is why should these archives be<br>
&gt;&gt;&gt;&gt; kept?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If you delete those archives you can no longer deactivate and<br>
&gt;&gt;&gt; re-activate a port. In addition to the use case above, this is also<br>
&gt;&gt;&gt; helpful when one of the files installed by the port was corrupted for<br>
&gt;&gt;&gt; some reason -- just de- and re-activate it.<br>
&gt;&gt;<br>
&gt;&gt; I suppose that if I were to manually delete those archives, MacPorts would not be so kind as to detect this and just start the build process over again, if he needs to ?<br>
&gt;<br>
&gt; Deactivating a port for which you&#39;ve deleted the archive would probably succeed, since the information about what files to remove comes from the registry and not from the archive, but attempting to reactivate it would probably give you an error message. Manually removing archives of installed ports from the software directory is not something we support at this time. MacPorts does not expect you to do that, and its behavior if you do is undefined.<br>
&gt;<br>
&gt;<br>
&gt;&gt; Would it be safe then to have some of /opt/local/var/macports symlink-ed on an external hard drive ?<br>
&gt;<br>
&gt; For the top level directories, I would say yes. I have had /opt/local/var/macports/distfiles symlinked elsewhere for years with no problems.<br>
&gt;<br>
&gt;<br>
&gt;&gt; I would only plug the drive if I need to activate/deactivate those old (and large) ports, but small ports would be stored on my main drive.<br>
&gt;&gt; Would MacPorts still function with such a setup ?<br>
&gt;<br>
&gt;<br>
&gt; Doing that would be unsupported, but it might work. At least until you uninstall the last version of a port: at that point, MacPorts would remove the directory (or in your case symlink) for that software. When you next install that software, a new directory would be created.<br>
&gt;<br>
&gt; Also, I don&#39;t know what kind of problem you might encounter if you forgot to plug in the drive while dealing with one of those ports whose software directories you had symlinked.<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; macports-users mailing list<br>
&gt; <a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;macports-users@lists.macosforge.org&#39;)">macports-users@lists.macosforge.org</a><br>
&gt; <a href="https://lists.macosforge.org/mailman/listinfo/macports-users" target="_blank">https://lists.macosforge.org/mailman/listinfo/macports-users</a><br>
<br>