Add meta data tags to all macports and homebrew files

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Does anybody have suggestions on the best way to do this? Is there some kind of tag in particular that I should use?

What I would like to do is add a tag like macports or homebrew to each file installed by them.
I often have things installed and do not know from where. Actual Apps from macports are installed in:
Code: Select all
/Applications/Macports
This should make for an easy win for those. It looks like it will be a bit more complicated for homebrew.

I think homebrew stores some symlinks in
Code: Select all
/usr/local/bin
, so that seem like a fair folder to monitor. (The binaries from the contents of stored here, sometimes from inside Apps...)

I will start with the macports directory. Surely somebody else has done this?
mmynsted
 
Posts: 5
Joined: Mon Jul 15, 2019 11:40 pm

Is there a reason you want to do this? In both cases, the installations are self contained within a particular folder tree.
Mr_Noodle
Site Admin
 
Posts: 8363
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I do not think in both cases. In the case of macports apps this is true. The issue is this:

I have a app that I am using. It is out of date. I need to update it. I can not recall if I installed this app from a download, macports, or homebrew. I then need to search to see. This takes time. It would be faster to simply read the tag on the app its self to see where it was installed so I can see where/how to update it. If this works for me I might change this to tag everything installed by macports and homebrew, not just apps. Then I can see there source simply from either the command line or the finder.

You might expect that some of this problem would be mitigated if I automated upgrades of macports and brew, but these updates are not without occasional failure. If the upgrades happen when I am not there to see them then things can simply stop working, or work differently than I expect.

I do want to do this. After I figure out how, then I can do other, perhaps more useful things.
mmynsted
 
Posts: 5
Joined: Mon Jul 15, 2019 11:40 pm

Brew does use `/usr/local/bin/` to link some command-line utilities, but apps are not included in that.

Brew _used_ to link apps from `/usr/local/Caskroom/` but they stopped doing that awhile ago (I believe it had something to do with App Translocation). As far as I can tell, there's no way to tell by looking at an app in /Applications/ that it was installed by `brew cask`

You can get a list of the currently-installed casks by using `brew cask list` but that will not only show apps, but also QuickLook generators, preference panes, and the like.

You can work-around this in a hack-y sort of way with this:

Code: Select all
brew cask list | while read line
do
brew cask info "$line" | fgrep -i '.app' | sed 's# (App)$##g'
done


that will show you all of the apps that have been installed by `brew cask install` but it is slow, even without many installed.

It is also not terribly useful with Hazel.
luomat
 
Posts: 43
Joined: Wed Mar 10, 2010 3:57 pm

Maybe you can figure out some sort of Smart Folder for this? If brew does not put everything in one place, I'm not sure how you would get Hazel to monitor it otherwise.
Mr_Noodle
Site Admin
 
Posts: 8363
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support