export HOMEBREW_INSTALL_FROM_API=1 - V2EX function format(tpl) { var index = 1, items = arguments; return (tpl || '').replace(/{(\w*)}/g, function(match, p1) { return items[index++] || p1 || match; }); } function loadCSS(url, callback) { return $('') .attr({ href: url }) .on('load', callback) .appendTo(document.head); } function lazyGist(element) { var $btn = $(element); var $self = $(element).parent(); var $link = $self.find('a'); $btn.prop('disabled', 'disabled').text('Loading...'); $.getJSON(format('{}.json?callback=?', $link.prop('href').replace($link.prop('hash'), ''))) .done(function(data) { loadCSS(data.stylesheet, function() { $self.replaceWith(data.div); $('.gist .gist-file .gist-meta a').filter(function() { return this.href === $link.prop('href'); }).parents('.gist-file').siblings().remove(); }); }) .fail(function() { $self.replaceWith($('
').attr('href', url).text(url)); }); }
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
clrss
V2EX    macOS

export HOMEBREW_INSTALL_FROM_API=1

  •  
  •   clrss Aug 11, 2022 1712 views
    This topic created in 1360 days ago, the information mentioned may be changed or developed.
    % man brew ... HOMEBREW_INSTALL_FROM_API If set, install formulae and casks in homebrew/core and homebrew/cask taps using Homebrews API instead of needing (large, slow) local checkouts of these repositories. Note: Setting HOMEBREW_INSTALL_FROM_API is not compatible with Homebrews developer mode so will error (as Homebrew development needs a full clone). 

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

    副作用未知.

    4 replies    2023-02-14 10:51:09 +08:00
    leon0318
        1
    leon0318  
       Aug 12, 2022 via iPhone
    副作用未知……
    clrss
        2
    clrss  
    OP
       Aug 12, 2022
    感觉不好用, 比如 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  
       Aug 15, 2022
    @clrss 为什么 shallow 会占 github 的 cpu 呢?
    按说 git 是各版本独立保存啊,只取最后版本其实不费什么事吧
    除非他们把最后一版和旧的一起 pack 了??
    clrss
        4
    clrss  
    OP
       Feb 14, 2023
    /t/915929 HOMEBREW_INSTALL_FROM_API 已经是默认设置了
    About     Help     Advertise     Blog     API     FAQ     Solana     2512 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 36ms UTC 08:21 PVG 16:21 LAX 01:21 JFK 04:21
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86