macos 仅限小桶的家酿配方

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4691403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 07:36:19  来源:igfitidea点击:

Keg-only homebrew formulas

macoshomebrew

提问by asymmetric

Today I installed the curlformula via homebrew, but after installing it (and re-sourcing the shell) i noticed that :

今天我curl通过安装了公式homebrew,但在安装它(并重新采购外壳)后,我注意到:

% which curl 
/usr/bin/curl

as a matter of fact, the output of brew install curlstated that it was a keg-onlyformula, and that since curlwas already present in OS X, it didn't link it into Homebrew prefix, as that could cause unspecified problems.

事实上,输出brew install curl声明它是一个仅限桶的公式,并且由于curl已经存在于 OS X 中,它没有将其链接到 Homebrew 前缀,因为这可能会导致未指定的问题。

Then it proceeds stating that

然后它继续说明

Generally there are no consequences of this for you

一般来说,这对你没有任何后果

I would like to know:

我想知道:

  • What sorts of problems exactly?
  • What is the purpose of installing keg-only formulas via Homebrew? How can there be no consequences if the newly installed tool is not in the PATH?
  • 究竟是哪些问题?
  • 通过 Homebrew 安装仅桶配方的目的是什么?如果新安装的工具不在PATH.

回答by martin clayton

  • Problems: if a homebrew application is put in the path in front of the default OS X version of the same, really anythingmight happen. Most common issues are caused by differences between the set of command line options available in the two versions, or differences in the meaning of the options. For curl the consequences might not be so bad, but for other applications you could, at worst, break the OS.
  • Keg-only: now you have two versions of curl! The default OS X, and the homebrew. If you want to use features that are not in the default but in the homebrew, you can do so by calling the homebrew curl explicitly. The precise path depends on how you've got homebrew set up. Because the newly installed version is not in the path, its unlikely to cause a problem unless it is explicitly called.
  • 问题:如果将自制应用程序放在相同的默认 OS X 版本前面的路径中,那么实际上可能会发生任何事情。最常见的问题是由两个版本中可用的命令行选项集之间的差异或选项含义的差异引起的。对于 curl 的后果可能不会那么糟糕,但对于其他应用程序,最坏的情况可能会破坏操作系统。
  • Keg-only:现在你有两个版本的 curl!默认的 OS X 和自制软件。如果要使用不在默认设置中但在自制软件中的功能,可以通过显式调用自制软件 curl 来实现。确切的路径取决于您如何设置自制软件。由于新安装的版本不在路径中,除非明确调用,否则不太可能导致问题。