V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
clrss
V2EX  ›  macOS

export HOMEBREW_INSTALL_FROM_API=1

  •  
  •   clrss · 2022-08-11 16:54:55 +08:00 · 1134 次点击
    这是一个创建于 616 天前的主题,其中的信息可能已经有所发展或是发生改变。
    % man brew
    ...
           HOMEBREW_INSTALL_FROM_API
                  If set, install formulae and casks in homebrew/core and homebrew/cask taps using Homebrew´s
                  API instead of needing (large, slow) local checkouts of these repositories.
    
                  Note: Setting HOMEBREW_INSTALL_FROM_API is not compatible with Homebrew´s developer mode so
                  will error (as Homebrew development needs a full clone).
    

    设置这个环境变量以后可以 brew untap homebrew/core brew untap homebrew/cask. 省几百 MB 空间. 先不说缺不缺这些空间, 把那十多年的 formula 历史放普通用户硬盘上本来就不科学.

    副作用未知.

    4 条回复    2023-02-14 10:51:09 +08:00
    leonme
        1
    leonme  
       2022-08-12 10:53:17 +08:00 via iPhone
    副作用未知……
    clrss
        2
    clrss  
    OP
       2022-08-12 11:41:00 +08:00
    感觉不好用, 比如 cleanup 会卡死.

    早年是 shallow clone, 没那么占空间, 后来 GitHub 说 CPU 占用太大不要 shallow.

    那我们换个源吧, 他们没说不能 shallow.
    export HOMEBREW_CORE_GIT_REMOTE=https://mirrors.ustc.edu.cn/homebrew-core.git
    https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

    需要改下 brew 代码, 我就不教了, 免得上面两镜像管理员来打我.
    julyclyde
        3
    julyclyde  
       2022-08-15 11:02:05 +08:00
    @clrss 为什么 shallow 会占 github 的 cpu 呢?
    按说 git 是各版本独立保存啊,只取最后版本其实不费什么事吧
    除非他们把最后一版和旧的一起 pack 了??
    clrss
        4
    clrss  
    OP
       2023-02-14 10:51:09 +08:00
    /t/915929 HOMEBREW_INSTALL_FROM_API 已经是默认设置了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3258 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:50 · PVG 20:50 · LAX 05:50 · JFK 08:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.