V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
vance123
V2EX  ›  macOS

本地 Homebrew formulae arm64 兼容性查询

  •  
  •   vance123 · Jan 1, 2021 · 1308 views
    This topic created in 1954 days ago, the information mentioned may be changed or developed.
    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)
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3093 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 13:46 · PVG 21:46 · LAX 06:46 · JFK 09:46
    ♥ Do have faith in what you're doing.