Find Universal?

Ryan Schmidt ryandesign at macports.org
Wed Jul 11 00:28:00 UTC 2018


On Jul 10, 2018, at 12:23, Adam Dershowitz wrote:

> Is there a way to find what base ports that I have installed are universal?

"base port" is not a term I'm familiar with, but you can show which ports have been installed with the universal variant using:

port -q installed | grep +universal


> I have ended up with a lot of ports that are universal variants.  I think that there are actually few, if any ports, that I have currently installed that need to be universal, but a while back I had a port or two that needed to be (ie wine).  And, then all the dependents ended up being universal.  Is there any way to figure out if any of my manually installed ports default to universal?

I suppose you could grep their Portfiles to see if they say "default_variants +universal".

port file requested | sort -u | xargs grep -E 'default_variants[[:space:]]+\+universal'


> Or if it is just dependents?  And, if that’s the case, is there a way to “update” those to be -universal?  

Not easily. I may have posted a long complicated command line to do that on this mailing list some years ago. 

It would be easy to reinstall *all* active ports to remove the universal variant, with something like:

sudo port upgrade --enforce-variants active -universal

But if any other port required any of those ports to be universal, that would break that other port. You could of course do this and then just see what breaks.


> I tried this:
> port echo requested |grep universal
> 
> And there are just 12, for example ghostscipt and findutils that default to universal.  

They may be installed universal on your system, but that is not their default installation mode, and there is no inherent reason why either of them need to be installed universal, unless of course it is required by another port that depends on them. Neither of those ports' Portfiles even contains the word "universal".


> I know that it could be done all by hand, but at the moment I have a total of 141 ports that are +universal, and no easy way to tell which default to that variant, which are that variant because of dependency issues, and which are that variant because of delated dependency issues.  That last category can be reinstall, but would have to be done in the right order, I think?

By grepping Portfiles, I count only 10 ports in our collection that default to the universal variant. That number may be slightly off, but it is a very rare occurrence.

Ports that are not 64-bit compatible, and that therefore only install 32-bit, and that therefore require their dependencies to be installed universal, are probably more common. You could show those ports that are installed for 32-bit only by using:

port -vq installed | grep "archs='i386'"



More information about the macports-users mailing list