import requests, subprocess
api = 'https://formulae.brew.sh/api/formula.json'
items = requests.get(api).json()
remote = {item['name']: item for item in items}
raw_string = subprocess.check_output(['/usr/local/bin/brew', 'list', '--formula'])
local = [raw.decode() for raw in raw_string.split()]
for f in local:
if f in remote:
try:
if 'arm64_big_sur' not in remote[f]['bottle']['stable']['files']:
print("not support:", f)
except:
print("unknown :", f)
else:
print("third party:", f)
使用方法:复制代码, 然后在终端中运行
python3 <(pbpaste)