Does MacPorts depend on Spotlight?

André-John Mas andrejohn.mas at
Wed Nov 17 19:16:51 UTC 2021

When looking at "System Preferences -> Spotlight -> Privacy", you can configure exclusions by folder.

I had a look at the mdutil command and no reference to folders or paths is mentioned, when looking from macOS 12.0.1:

Usage: mdutil -pEsa -i (on|off) -d volume ...
       mdutil -t {volume-path | deviceid} fileid
	Utility to manage Spotlight indexes.
	-i (on|off)    Turn indexing on or off.
	-d             Disable Spotlight activity for volume (re-enable using -i on).
	-E             Erase and rebuild index.
	-s             Print indexing status.
	-a             Apply command to all stores on all volumes.
	-t             Resolve files from file id with an optional volume path or device id.
	-p             Publish metadata.
	-V vol         Apply command to all stores on the specified volume.
	-v             Display verbose information.
	-r plugins     Ask the server to reimport files for UTIs claimed by the listed plugin.
	-L volume-path List the directory contents of the Spotlight index on the specified volume.
	-P volume-path Dump the VolumeConfig.plist for the specified volume.
	-X volume-path Remove the Spotlight index directory on the specified volume.  Does not disable indexing.
	               Spotlight will reevaluate volume when it is unmounted and remounted, the
	               machine is rebooted, or an explicit index command such as 'mdutil -i' or 'mdutil -E' is
	               run for the volume.
NOTE: Run as owner for network homes, otherwise run as root.

I am starting to wonder if there is another command we should be using, in place of mdutil?

> On 17 Nov, 2021, at 13:31, Peter Hancock <hancock at> wrote:
> On 17/11/2021 15:46, Chris Jones wrote:
>> Some users might find it useful, and the exact volume to exclude
>> depends on the details of the users installation, which would be
>> difficult to automate. So I think its fine to just leave it to be
>> done by hand by those that wish to.
>> On 17/11/2021 3:09 pm, André-John Mas wrote:
>>> Just wondering whether it would make sense for MacPorts to auto
>>> exclude that folder? Does spotlight even provide an API or command
>>> that would allow MacPorts to do that?>>
> André-John Mas mentions folders (directories?), while Chris Jones mentions volumes
> (mounted filesystems?).
> On Catalina, for me the command "sudo mdutil -i off /opt/local/var/macports "
> evokes:
> [
> Password:
> /System/Volumes/Data/opt/local/var/macports:
> Error: invalid operation.
> 	Error: unknown indexing state.
> ]
> Trying to drag that directory into the appropriate System Preferences "privacy" pane,
> accomplishes nothing. It doesn't appear on the list.
> My man page for mdutil seems to speak only about volumes. A bit of googling suggests
> that though there *may* have been a time when you could exclude various directories
> from spotlight indexing, by one trick or another, those days are gone.
> Am I wrong?
> I hope so. I'm getting pretty dyspeptic about how much of my computer seems to be
> taken over by Spotlight and it's various underlings/minions.
> (Eg, It/they seem(s) to spend a large chunk of resources on creating tens/hundreds of thousands
> of empty directories deep under /private/var/folders, to no apparent purpose.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list