language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
Homebrew
brew
3680c4667f1a47000c0152ca34bc3af7c41825ac.json
man: replace split header/footer with ERB template
Library/Homebrew/manpages/header.1.md
@@ -1,38 +0,0 @@ -brew(1) -- The missing package manager for OS X -=============================================== - -## SYNOPSIS - -`brew` `--version`<br> -`brew` <command> [`--verbose`|`-v`] [<options>] [<formula>] ... - -## DESCRIPTION - -Homebrew is the easiest and most flexible way to install the UNIX tools Apple -didn't include with OS X. - -## ESSENTIAL COMMANDS - -For the full command list, see the [COMMANDS][] section. - -With `--verbose` or `-v`, many commands print extra debugging information. Note that these flags should only appear after a command. - - * `install` <formula>: - Install <formula>. - - * `remove` <formula>: - Uninstall <formula>. - - * `update`: - Fetch the newest version of Homebrew from GitHub using `git`(1). - - * `list`: - List all installed formulae. - - * `search` <text>|`/`<text>`/`: - Perform a substring search of formula names for <text>. If <text> is - surrounded with slashes, then it is interpreted as a regular expression. - The search for <text> is extended online to some popular taps. - If no search term is given, all locally available formulae are listed. - -## COMMANDS
true
Other
Homebrew
brew
8e42077a8eeb827c3ffcdf08195239c8f82cb588.json
list: exclude zsh completions from unbrewed Since edf000e4cd30c3626ccc28c52ed32f2d84a200dd `zsh` completions are in `share/zsh/site-functions/_brew`, making this path a part of Homebrew. Hide it from `brew list --unbrewed` to reduce confusion/noise.
Library/Homebrew/cmd/list.rb
@@ -78,6 +78,7 @@ def list share/info/dir share/man/man1/brew.1 share/man/whatis + share/zsh/site-functions/_brew ] def list_unbrewed
false
Other
Homebrew
brew
e0264302c7cca1b6b472aba912bfe100489bd698.json
doc: remove outdated documentation for completion (#99) By the commit edf000e4cd30c3626ccc28c52ed32f2d84a200dd, bash and zsh completion scripts have been moved to `etc/bash_completion.d/brew` and `share/zsh/site-functions/_brew`, respectively. Now completion will be done automatically without any trick.
share/doc/homebrew/Tips-N'-Tricks.md
@@ -42,22 +42,6 @@ Use `brew info $FORMULA` to check what versions are installed but not currently ./configure --prefix=/usr/local/Cellar/foo/1.2 && make && make install && brew link foo ``` -## Command tab-completion - -### Bash -Add to your `~/.bashrc` or `~/.bash_profile` (whichever you have configured to run on shell startup): - -```bash -source $(brew --repository)/Library/Contributions/brew_bash_completion.sh -``` - -### Zsh -Run in terminal (may require `sudo`): - -```zsh -ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" /usr/local/share/zsh/site-functions/_brew -``` - ## Pre-downloading a file for a formula Sometimes it's faster to download a file via means other than those
false
Other
Homebrew
brew
f6d5ae2253813f868e8c2e0170f3260dcc5c25e4.json
analytics: add more documentation, Linuxbrew ID. (#98)
Library/Homebrew/utils/analytics.sh
@@ -12,7 +12,17 @@ setup-analytics() { HOMEBREW_ANALYTICS_USER_UUID="$(uuidgen)" echo "$HOMEBREW_ANALYTICS_USER_UUID" > "$HOMEBREW_ANALYTICS_USER_UUID_FILE" fi - export HOMEBREW_ANALYTICS_ID="UA-75654628-1" + + if [[ -n "$HOMEBREW_LINUX" ]] + then + # For Linuxbrew's analytics. + HOMEBREW_ANALYTICS_ID="UA-76492262-1" + else + # Otherwise, fall back to Homebrew's analytics. + HOMEBREW_ANALYTICS_ID="UA-75654628-1" + fi + + export HOMEBREW_ANALYTICS_ID export HOMEBREW_ANALYTICS_USER_UUID }
true
Other
Homebrew
brew
f6d5ae2253813f868e8c2e0170f3260dcc5c25e4.json
analytics: add more documentation, Linuxbrew ID. (#98)
share/doc/homebrew/Analytics.md
@@ -1,8 +1,11 @@ -# Analytics +# Homebrew's Anonymous Aggregate User Behaviour Analytics Homebrew will shortly begin gathering anonymous aggregate user behaviour analytics and reporting these to Google Analytics. ## Why? -Homebrew is provided free of charge and run entirely by volunteers in their spare time. As a result, we do not have the resources to do detailed user studies of Homebrew users to decide on how best to design future features and prioritise current work. Anonymous aggregate user analytics allow us to prioritise fixes and features based on how, where and when people use Homebrew. For example, if a formulae is widely used and is failing often it will enable us to prioritise fixing that formula over others. +Homebrew is provided free of charge and run entirely by volunteers in their spare time. As a result, we do not have the resources to do detailed user studies of Homebrew users to decide on how best to design future features and prioritise current work. Anonymous aggregate user analytics allow us to prioritise fixes and features based on how, where and when people use Homebrew. For example: + +- if a formulae is widely used and is failing often it will enable us to prioritise fixing that formula over others. +- collecting the OS version allows us to decide what versions of OS X to prioritise and support and identify build failures that occur only on single versions. ## What? Homebrew's analytics record some shared information for every event: @@ -19,7 +22,7 @@ Homebrew's analytics record some shared information for every event: Homebrew's analytics records the following different events: - a `screenview` hit type with the official Homebrew command you have run (with arguments stripped) e.g. `brew list` (not `brew list foo` or any external commands except `bundle`, `cask` and `services`) -- an `event` hit type with the `install` event category, the Homebrew formula from a non-private GitHub tap you have requested to install and any used options e.g. `wget --with-pcre` as the action and an event label e.g. `Mac OS X 10.11, non-/usr/local, CI` to indicate the OS version, non-standard installation location and invocation as part of CI +- an `event` hit type with the `install` event category, the Homebrew formula from a non-private GitHub tap you have requested to install and any used options e.g. `wget --with-pcre` as the action and an event label e.g. `Mac OS X 10.11, non-/usr/local, CI` to indicate the OS version, non-standard installation location and invocation as part of CI. This allows us to identify formulae that need fixed and where more easily. - an `event` hit type with the `BuildError` event category, the Homebrew formula that failed to install e.g. `wget` as the action and an event label e.g. `Mac OS X 10.11` - an `exception` hit type with the `exception` event category, exception description of the exception name e.g. `FormulaUnavailableError` and whether the exception was fatal e.g. `1` @@ -29,10 +32,13 @@ It is impossible for the Homebrew developers to match any particular event to an ![Aggregate user analytics](images/analytics.png) -It is impossible for Google to match a Homebrew analytics user ID to any other Google Analytics user ID. If Google turned evil the only thing they could do would be to lie about anonymising IP addresses and attempt to match users based on IP addresses. +As far as we can tell it would be impossible Google to match the randomly generated Homebrew-only analytics user ID to any other Google Analytics user ID. If Google turned evil the only thing they could do would be to lie about anonymising IP addresses and attempt to match users based on IP addresses. + +## When/Where? +Homebrew's analytics are sent throughout Homebrew's execution to Google Analytics over HTTPS. -## When? -Homebrew's analytics are sent throughout Homebrew's execution to Google Analytics. +## Who? +Homebrew's analytics are accessible to Homebrew's current maintainers. Contact @mikemcquaid if you are a maintainer and need access. ## How? The code is viewable in https://github.com/Homebrew/brew/blob/master/Library/Homebrew/utils/analytics.rb and https://github.com/Homebrew/brew/blob/master/Library/Homebrew/utils/analytics.sh. They are done in a separate background process and fail fast to avoid delaying any execution. They will fail immediately and silently if you have no network connection.
true
Other
Homebrew
brew
b70e4341fe1a217d51f2bf75b5e2fdb1f4e602d9.json
style: use rubocop 0.39 (#85)
Library/Homebrew/cmd/style.rb
@@ -8,7 +8,7 @@ def style ARGV.formulae.map(&:path) end - Homebrew.install_gem_setup_path! "rubocop", "0.37.2" + Homebrew.install_gem_setup_path! "rubocop", "0.39" args = [ "--format", "simple", "--force-exclusion", "--config",
false
Other
Homebrew
brew
36b2af2e0f5a72f0eccdec0c929a89188dc0f0dc.json
superenv: fix formula prefix path to consider revisions Old logic doesn't include revision. This fixes that, and passes the whole formula prefix path to avoid duplicating the path-construction logic. Closes #80. Signed-off-by: Andrew Janke <andrew@apjanke.net>
Library/ENV/4.3/cc
@@ -15,7 +15,7 @@ require "set" class Cmd attr_reader :config, :prefix, :cellar, :opt, :tmpdir, :sysroot, :deps - attr_reader :archflags, :optflags, :keg_regex, :formula, :formula_version + attr_reader :archflags, :optflags, :keg_regex, :formula_prefix def initialize(arg0, args) @arg0 = arg0 @@ -29,8 +29,7 @@ class Cmd @archflags = ENV.fetch("HOMEBREW_ARCHFLAGS") { "" }.split(" ") @optflags = ENV.fetch("HOMEBREW_OPTFLAGS") { "" }.split(" ") @deps = Set.new(ENV.fetch("HOMEBREW_DEPENDENCIES") { "" }.split(",")) - @formula = ENV["HOMEBREW_FORMULA"] - @formula_version = ENV["HOMEBREW_FORMULA_VERSION"] + @formula_prefix = ENV["HOMEBREW_FORMULA_PREFIX"] # matches opt or cellar prefix and formula name @keg_regex = %r[(#{Regexp.escape(opt)}|#{Regexp.escape(cellar)})/([\w\-_\+]+)] end @@ -208,7 +207,7 @@ class Cmd return keep_orig?(path) unless ENV["HOMEBREW_EXPERIMENTAL_FILTER_FLAGS_ON_DEPS"] # Allow references to self - if keg_path && path.start_with?(keg_path) + if formula_prefix && path.start_with?("#{formula_prefix}/") true # first two paths: reject references to Cellar or opt paths # for unspecified dependencies @@ -281,11 +280,6 @@ class Cmd %W[#{sysroot}/usr/lib /usr/local/lib] end - def keg_path - return nil if formula.nil? - "#{cellar}/#{formula}/#{formula_version}" - end - def configure? # configure scripts generated with autoconf 2.61 or later export as_nl ENV.key? "as_nl"
true
Other
Homebrew
brew
36b2af2e0f5a72f0eccdec0c929a89188dc0f0dc.json
superenv: fix formula prefix path to consider revisions Old logic doesn't include revision. This fixes that, and passes the whole formula prefix path to avoid duplicating the path-construction logic. Closes #80. Signed-off-by: Andrew Janke <andrew@apjanke.net>
Library/Homebrew/extend/ENV/super.rb
@@ -69,8 +69,7 @@ def setup_build_environment(formula = nil) self["HOMEBREW_LIBRARY_PATHS"] = determine_library_paths self["HOMEBREW_DEPENDENCIES"] = determine_dependencies unless formula.nil? - self["HOMEBREW_FORMULA"] = formula.name - self["HOMEBREW_FORMULA_VERSION"] = formula.version + self["HOMEBREW_FORMULA_PREFIX"] = formula.prefix end if MacOS::Xcode.without_clt? || (MacOS::Xcode.installed? && MacOS::Xcode.version.to_i >= 7)
true
Other
Homebrew
brew
a8ed06ba741b627f48d2a9ec76f2aa62aec2c160.json
superenv: allow paths under self's keg Fixes build error in Homebrew/homebrew-core#100. Closes #63. Signed-off-by: Andrew Janke <andrew@apjanke.net>
Library/ENV/4.3/cc
@@ -15,7 +15,7 @@ require "set" class Cmd attr_reader :config, :prefix, :cellar, :opt, :tmpdir, :sysroot, :deps - attr_reader :archflags, :optflags, :keg_regex + attr_reader :archflags, :optflags, :keg_regex, :formula, :formula_version def initialize(arg0, args) @arg0 = arg0 @@ -29,6 +29,8 @@ class Cmd @archflags = ENV.fetch("HOMEBREW_ARCHFLAGS") { "" }.split(" ") @optflags = ENV.fetch("HOMEBREW_OPTFLAGS") { "" }.split(" ") @deps = Set.new(ENV.fetch("HOMEBREW_DEPENDENCIES") { "" }.split(",")) + @formula = ENV["HOMEBREW_FORMULA"] + @formula_version = ENV["HOMEBREW_FORMULA_VERSION"] # matches opt or cellar prefix and formula name @keg_regex = %r[(#{Regexp.escape(opt)}|#{Regexp.escape(cellar)})/([\w\-_\+]+)] end @@ -205,9 +207,12 @@ class Cmd # but is currently opt-in. return keep_orig?(path) unless ENV["HOMEBREW_EXPERIMENTAL_FILTER_FLAGS_ON_DEPS"] + # Allow references to self + if keg_path && path.start_with?(keg_path) + true # first two paths: reject references to Cellar or opt paths # for unspecified dependencies - if path.start_with?(cellar) || path.start_with?(opt) + elsif path.start_with?(cellar) || path.start_with?(opt) dep = path[keg_regex, 2] dep && @deps.include?(dep) elsif path.start_with?(prefix) @@ -276,6 +281,11 @@ class Cmd %W[#{sysroot}/usr/lib /usr/local/lib] end + def keg_path + return nil if formula.nil? + "#{cellar}/#{formula}/#{formula_version}" + end + def configure? # configure scripts generated with autoconf 2.61 or later export as_nl ENV.key? "as_nl"
true
Other
Homebrew
brew
a8ed06ba741b627f48d2a9ec76f2aa62aec2c160.json
superenv: allow paths under self's keg Fixes build error in Homebrew/homebrew-core#100. Closes #63. Signed-off-by: Andrew Janke <andrew@apjanke.net>
Library/Homebrew/extend/ENV/super.rb
@@ -68,6 +68,10 @@ def setup_build_environment(formula = nil) self["HOMEBREW_INCLUDE_PATHS"] = determine_include_paths self["HOMEBREW_LIBRARY_PATHS"] = determine_library_paths self["HOMEBREW_DEPENDENCIES"] = determine_dependencies + unless formula.nil? + self["HOMEBREW_FORMULA"] = formula.name + self["HOMEBREW_FORMULA_VERSION"] = formula.version + end if MacOS::Xcode.without_clt? || (MacOS::Xcode.installed? && MacOS::Xcode.version.to_i >= 7) self["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s
true
Other
Homebrew
brew
f57739deda5a1ee099d1acab18384a130a9b95ad.json
travis: remove dead code
.travis.yml
@@ -1,5 +1,4 @@ -# Force OS X. -language: objective-c +language: ruby os: osx env: OSX=10.11 osx_image: xcode7.3 @@ -17,13 +16,6 @@ before_install: fi - git reset --hard $TRAVIS_COMMIT - git clean -qxdff - -install: - - if [ "$HOMEBREW_RUBY" = "1.8.7" ]; then - brew install homebrew/versions/ruby187; - export HOMEBREW_RUBY_PATH="/usr/local/opt/ruby187/bin/ruby"; - brew untap homebrew/versions; - fi - export HOMEBREW_DEVELOPER="1" - ulimit -n 1024
false
Other
Homebrew
brew
0382134cf87321166fb8f03223e21b1d242ad7cb.json
brew.rb: adjust behavior for undocumented commands Don't exit with a non-zero status code just because an internal command happens to be undocumented. Also print the generic help in these cases to provide some help (including a reference to the man page).
Library/brew.rb
@@ -83,8 +83,9 @@ def require?(path) if help_text.nil? # External command, let it handle help by itself elsif help_text.empty? - puts "No help available for #{cmd}" - exit 1 + opoo "No help available for '#{cmd}' command." + puts ARGV.usage + exit 0 else puts help_text exit 0
false
Other
Homebrew
brew
10edfcd218daf522db5a9d43a368572441dc0b5a.json
Fix documentation error Closes #10. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Library/Homebrew/cmd/fetch.rb
@@ -1,6 +1,6 @@ #: * `fetch` [`--force`] [`-v`] [`--devel`|`--HEAD`] [`--deps`] [`--build-from-source`|`--force-bottle`] <formulae>: #: Download the source packages for the given <formulae>. -#: For tarballs, also print SHA-1 and SHA-256 checksums. +#: For tarballs, also print SHA-256 checksums. #: #: If `--HEAD` or `--devel` is passed, fetch that version instead of the #: stable version.
true
Other
Homebrew
brew
10edfcd218daf522db5a9d43a368572441dc0b5a.json
Fix documentation error Closes #10. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Library/Homebrew/manpages/brew.1.md
@@ -154,7 +154,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note * `fetch` [`--force`] [`-v`] [`--devel`|`--HEAD`] [`--deps`] [`--build-from-source`|`--force-bottle`] <formulae>: Download the source packages for the given <formulae>. - For tarballs, also print SHA-1 and SHA-256 checksums. + For tarballs, also print SHA-256 checksums. If `--HEAD` or `--devel` is passed, fetch that version instead of the stable version.
true
Other
Homebrew
brew
10edfcd218daf522db5a9d43a368572441dc0b5a.json
Fix documentation error Closes #10. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
share/doc/homebrew/brew.1.html
@@ -123,7 +123,7 @@ <h2 id="COMMANDS">COMMANDS</h2> <dt class="flush"><code>edit</code></dt><dd><p>Open all of Homebrew for editing.</p></dd> <dt><code>edit</code> <var>formula</var></dt><dd><p>Open <var>formula</var> in the editor.</p></dd> <dt><code>fetch</code> [<code>--force</code>] [<code>-v</code>] [<code>--devel</code>|<code>--HEAD</code>] [<code>--deps</code>] [<code>--build-from-source</code>|<code>--force-bottle</code>] <var>formulae</var></dt><dd><p>Download the source packages for the given <var>formulae</var>. -For tarballs, also print SHA-1 and SHA-256 checksums.</p> +For tarballs, also print SHA-256 checksums.</p> <p>If <code>--HEAD</code> or <code>--devel</code> is passed, fetch that version instead of the stable version.</p>
true
Other
Homebrew
brew
10edfcd218daf522db5a9d43a368572441dc0b5a.json
Fix documentation error Closes #10. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
share/man/man1/brew.1
@@ -164,7 +164,7 @@ Open \fIformula\fR in the editor\. . .TP \fBfetch\fR [\fB\-\-force\fR] [\fB\-v\fR] [\fB\-\-devel\fR|\fB\-\-HEAD\fR] [\fB\-\-deps\fR] [\fB\-\-build\-from\-source\fR|\fB\-\-force\-bottle\fR] \fIformulae\fR -Download the source packages for the given \fIformulae\fR\. For tarballs, also print SHA\-1 and SHA\-256 checksums\. +Download the source packages for the given \fIformulae\fR\. For tarballs, also print SHA\-256 checksums\. . .IP If \fB\-\-HEAD\fR or \fB\-\-devel\fR is passed, fetch that version instead of the stable version\.
true
Other
Homebrew
brew
c8a2cd4e10e6ea1d4e10531fbbc1ef10b0741815.json
Generate the new man page
Library/Homebrew/manpages/brew.1.md
@@ -275,14 +275,14 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note If provided, `--local` will symlink them into the user's `~/Applications` directory instead of the system directory. - * `ls`, `list` [`--full-name`]: + * `list`, `ls` [`--full-name`]: List all installed formulae. If `--full-name` is passed, print formulae with full-qualified names. - * `ls`, `list` `--unbrewed`: + * `list`, `ls` `--unbrewed`: List all files in the Homebrew prefix not installed by Homebrew. - * `ls`, `list` [`--versions` [`--multiple`]] [`--pinned`] [<formulae>]: + * `list`, `ls` [`--versions` [`--multiple`]] [`--pinned`] [<formulae>]: List the installed files for <formulae>. Combined with `--verbose`, recursively list the contents of all subdirectories in each <formula>'s keg. @@ -298,18 +298,18 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note Show the git log for the given formulae. Options that `git-log`(1) recognizes can be passed before the formula list. - * `missing` [<formulae>]: - Check the given <formulae> for missing dependencies. - - If no <formulae> are given, check all installed brews. - * `migrate` [`--force`] <formulae>: Migrate renamed packages to new name, where <formulae> are old names of packages. If `--force` is passed, then treat installed <formulae> and passed <formulae> like if they are from same taps and migrate them anyway. + * `missing` [<formulae>]: + Check the given <formulae> for missing dependencies. + + If no <formulae> are given, check all installed brews. + * `options` [`--compact`] (`--all`|`--installed`|<formulae>): Display install options specific to <formulae>. @@ -350,12 +350,6 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note * `reinstall` <formula>: Uninstall then install <formula> - * `rm`, `remove`, `uninstall` [`--force`] <formula>: - Uninstall <formula>. - - If `--force` is passed, and there are multiple versions of <formula> - installed, delete all installed versions. - * `search`, `-S`: Display all locally available formulae for brewing (including tapped ones). No online search is performed if called without arguments. @@ -444,6 +438,12 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note Example: `brew install jruby && brew test jruby` + * `uninstall`, `rm`, `remove` [`--force`] <formula>: + Uninstall <formula>. + + If `--force` is passed, and there are multiple versions of <formula> + installed, delete all installed versions. + * `unlink` [`--dry-run`] <formula>: Remove symlinks for <formula> from the Homebrew prefix. This can be useful for temporarily disabling a formula:
true
Other
Homebrew
brew
c8a2cd4e10e6ea1d4e10531fbbc1ef10b0741815.json
Generate the new man page
Library/Homebrew/manpages/footer.1.md
@@ -0,0 +1,231 @@ + + + * `--cache`: + Display Homebrew's download cache. See also `HOMEBREW_CACHE`. + + * `--cache` <formula>: + Display the file or directory used to cache <formula>. + + * `--cellar`: + Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if + that directory doesn't exist, `$(brew --repository)/Cellar`. + + * `--cellar` <formula>: + Display the location in the cellar where <formula> would be installed, + without any sort of versioned directory as the last path. + + * `--env`: + Show a summary of the Homebrew build environment. + + * `--prefix`: + Display Homebrew's install path. *Default:* `/usr/local` + + * `--prefix` <formula>: + Display the location in the cellar where <formula> is or would be installed. + + * `--repository`: + Display where Homebrew's `.git` directory is located. For standard installs, + the `prefix` and `repository` are the same directory. + + * `--repository` <user>`/`<repo>: + Display where tap <user>`/`<repo>'s directory is located. + + * `--version`: + Print the version number of brew to standard error and exit. + +## EXTERNAL COMMANDS + +Homebrew, like `git`(1), supports external commands. These are executable +scripts that reside somewhere in the `PATH`, named `brew-`<cmdname> or +`brew-`<cmdname>`.rb`, which can be invoked like `brew` <cmdname>. This allows you +to create your own commands without modifying Homebrew's internals. + +Instructions for creating your own commands can be found in the docs: +<https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/External-Commands.md> + +## SPECIFYING FORMULAE + +Many Homebrew commands accept one or more <formula> arguments. These arguments +can take several different forms: + + * The name of a formula: + e.g. `git`, `node`, `wget`. + + * The fully-qualified name of a tapped formula: + Sometimes a formula from a tapped repository may conflict with one in `Homebrew/homebrew`. + You can still access these formulae by using a special syntax, e.g. + `homebrew/dupes/vim` or `homebrew/versions/node4`. + + * An arbitrary URL: + Homebrew can install formulae via URL, e.g. + `https://raw.github.com/Homebrew/homebrew-core/master/Formula/git.rb`. + The formula file will be cached for later use. + +## ENVIRONMENT + + * `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`: + When using the `S3` download strategy, Homebrew will look in + these variables for access credentials (see + <https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment> + to retrieve these access credentials from AWS). If they are not set, + the `S3` download strategy will download with a public + (unsigned) URL. + + * `BROWSER`: + If set, and `HOMEBREW_BROWSER` is not, use `BROWSER` as the web browser + when opening project homepages. + + * `EDITOR`: + If set, and `HOMEBREW_EDITOR` and `VISUAL` are not, use `EDITOR` as the text editor. + + * `GIT`: + When using Git, Homebrew will use `GIT` if set, + a Homebrew-built Git if installed, or the system-provided binary. + + Set this to force Homebrew to use a particular git binary. + + * `HOMEBREW_BOTTLE_DOMAIN`: + If set, instructs Homebrew to use the given URL as a download mirror for bottles. + + * `HOMEBREW_BROWSER`: + If set, uses this setting as the browser when opening project homepages, + instead of the OS default browser. + + * `HOMEBREW_BUILD_FROM_SOURCE`: + If set, instructs Homebrew to compile from source even when a formula + provides a bottle. This environment variable is intended for use by + Homebrew developers. Please do not file issues if you encounter errors when + using this environment variable. + + * `HOMEBREW_CACHE`: + If set, instructs Homebrew to use the given directory as the download cache. + + *Default:* `~/Library/Caches/Homebrew` if it exists; otherwise, + `/Library/Caches/Homebrew`. + + * `HOMEBREW_CURL_VERBOSE`: + If set, Homebrew will pass `--verbose` when invoking `curl`(1). + + * `HOMEBREW_DEBUG`: + If set, any commands that can emit debugging information will do so. + + * `HOMEBREW_DEBUG_INSTALL`: + When `brew install -d` or `brew install -i` drops into a shell, + `HOMEBREW_DEBUG_INSTALL` will be set to the name of the formula being + brewed. + + * `HOMEBREW_DEBUG_PREFIX`: + When `brew install -d` or `brew install -i` drops into a shell, + `HOMEBREW_DEBUG_PREFIX` will be set to the target prefix in the Cellar + of the formula being brewed. + + * `HOMEBREW_DEVELOPER`: + If set, Homebrew will print warnings that are only relevant to Homebrew + developers (active or budding). + + * `HOMEBREW_EDITOR`: + If set, Homebrew will use this editor when editing a single formula, or + several formulae in the same directory. + + *NOTE*: `brew edit` will open all of Homebrew as discontinuous files and + directories. TextMate can handle this correctly in project mode, but many + editors will do strange things in this case. + + * `HOMEBREW_GITHUB_API_TOKEN`: + A personal access token for the GitHub API, which you can create at + <https://github.com/settings/tokens>. If set, GitHub will allow you a + greater number of API requests. See + <https://developer.github.com/v3/#rate-limiting> for more information. + Homebrew uses the GitHub API for features such as `brew search`. + + *NOTE*: Homebrew doesn't require permissions for any of the scopes. + + * `HOMEBREW_LOGS`: + If set, Homebrew will use the given directory to store log files. + + * `HOMEBREW_MAKE_JOBS`: + If set, instructs Homebrew to use the value of `HOMEBREW_MAKE_JOBS` as + the number of parallel jobs to run when building with `make`(1). + + *Default:* the number of available CPU cores. + + * `HOMEBREW_NO_EMOJI`: + If set, Homebrew will not print the `HOMEBREW_INSTALL_BADGE` on a + successful build. + + *Note:* Homebrew will only try to print emoji on Lion or newer. + + * `HOMEBREW_NO_INSECURE_REDIRECT`: + If set, Homebrew will not permit redirects from secure HTTPS + to insecure HTTP. + + While ensuring your downloads are fully secure, this is likely + to cause from-source Sourceforge & GNOME based formulae + to fail to download. + + Apache formulae are currently unaffected by this variable and + can redirect to plaintext. + + * `HOMEBREW_NO_GITHUB_API`: + If set, Homebrew will not use the GitHub API for e.g searches or + fetching relevant issues on a failed install. + + * `HOMEBREW_INSTALL_BADGE`: + Text printed before the installation summary of each successful build. + Defaults to the beer emoji. + + * `HOMEBREW_SVN`: + When exporting from Subversion, Homebrew will use `HOMEBREW_SVN` if set, + a Homebrew-built Subversion if installed, or the system-provided binary. + + Set this to force Homebrew to use a particular `svn` binary. + + * `HOMEBREW_TEMP`: + If set, instructs Homebrew to use `HOMEBREW_TEMP` as the temporary directory + for building packages. This may be needed if your system temp directory and + Homebrew Prefix are on different volumes, as OS X has trouble moving + symlinks across volumes when the target does not yet exist. + + This issue typically occurs when using FileVault or custom SSD + configurations. + + * `HOMEBREW_VERBOSE`: + If set, Homebrew always assumes `--verbose` when running commands. + + * `VISUAL`: + If set, and `HOMEBREW_EDITOR` is not, use `VISUAL` as the text editor. + +## USING HOMEBREW BEHIND A PROXY + +Homebrew uses several commands for downloading files (e.g. `curl`, `git`, `svn`). +Many of these tools can download via a proxy. It's common for these tools +to read proxy parameters from environment variables. + +For the majority of cases setting `http_proxy` is enough. You can set this in +your shell profile, or you can use it before a brew command: + + http_proxy=http://<host>:<port> brew install foo + +If your proxy requires authentication: + + http_proxy=http://<user>:<password>@<host>:<port> brew install foo + +## SEE ALSO + +Homebrew Documentation: <https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/> + +`git`(1), `git-log`(1) + +## AUTHORS + +Homebrew's current maintainers are Misty De Meo, Andrew Janke, Xu Cheng, Mike McQuaid, Baptiste Fontaine, Brett Koonce, Martin Afanasjew, Dominyk Tiller, Tim Smith and Alex Dunn. + +Former maintainers with significant contributions include Jack Nagel, Adam Vandenberg and Homebrew's creator: Max Howell. + +## BUGS + +See our issues on GitHub: + + * Homebrew/brew <https://github.com/Homebrew/brew/issues> + + * Homebrew/homebrew-core <https://github.com/Homebrew/homebrew-core/issues>
true
Other
Homebrew
brew
c8a2cd4e10e6ea1d4e10531fbbc1ef10b0741815.json
Generate the new man page
Library/Homebrew/manpages/header.1.md
@@ -0,0 +1,38 @@ +brew(1) -- The missing package manager for OS X +=============================================== + +## SYNOPSIS + +`brew` `--version`<br> +`brew` <command> [`--verbose`|`-v`] [<options>] [<formula>] ... + +## DESCRIPTION + +Homebrew is the easiest and most flexible way to install the UNIX tools Apple +didn't include with OS X. + +## ESSENTIAL COMMANDS + +For the full command list, see the [COMMANDS][] section. + +With `--verbose` or `-v`, many commands print extra debugging information. Note that these flags should only appear after a command. + + * `install` <formula>: + Install <formula>. + + * `remove` <formula>: + Uninstall <formula>. + + * `update`: + Fetch the newest version of Homebrew from GitHub using `git`(1). + + * `list`: + List all installed formulae. + + * `search` <text>|`/`<text>`/`: + Perform a substring search of formula names for <text>. If <text> is + surrounded with slashes, then it is interpreted as a regular expression. + The search for <text> is extended online to some popular taps. + If no search term is given, all locally available formulae are listed. + +## COMMANDS
true
Other
Homebrew
brew
c8a2cd4e10e6ea1d4e10531fbbc1ef10b0741815.json
Generate the new man page
share/doc/homebrew/brew.1.html
@@ -221,10 +221,10 @@ <h2 id="COMMANDS">COMMANDS</h2> <p>If provided, <code>--local</code> will symlink them into the user's <code>~/Applications</code> directory instead of the system directory.</p></dd> -<dt><code>ls</code>, <code>list</code> [<code>--full-name</code>]</dt><dd><p>List all installed formulae. If <code>--full-name</code> is passed, print formulae with +<dt><code>list</code>, <code>ls</code> [<code>--full-name</code>]</dt><dd><p>List all installed formulae. If <code>--full-name</code> is passed, print formulae with full-qualified names.</p></dd> -<dt><code>ls</code>, <code>list</code> <code>--unbrewed</code></dt><dd><p>List all files in the Homebrew prefix not installed by Homebrew.</p></dd> -<dt><code>ls</code>, <code>list</code> [<code>--versions</code> [<code>--multiple</code>]] [<code>--pinned</code>] [<var>formulae</var>]</dt><dd><p>List the installed files for <var>formulae</var>. Combined with <code>--verbose</code>, recursively +<dt><code>list</code>, <code>ls</code> <code>--unbrewed</code></dt><dd><p>List all files in the Homebrew prefix not installed by Homebrew.</p></dd> +<dt><code>list</code>, <code>ls</code> [<code>--versions</code> [<code>--multiple</code>]] [<code>--pinned</code>] [<var>formulae</var>]</dt><dd><p>List the installed files for <var>formulae</var>. Combined with <code>--verbose</code>, recursively list the contents of all subdirectories in each <var>formula</var>'s keg.</p> <p>If <code>--versions</code> is passed, show the version number for installed formulae, @@ -236,14 +236,14 @@ <h2 id="COMMANDS">COMMANDS</h2> See also <code>pin</code>, <code>unpin</code>.</p></dd> <dt><code>log</code> [<code>git-log-options</code>] <var>formula</var> ...</dt><dd><p>Show the git log for the given formulae. Options that <code>git-log</code>(1) recognizes can be passed before the formula list.</p></dd> -<dt><code>missing</code> [<var>formulae</var>]</dt><dd><p>Check the given <var>formulae</var> for missing dependencies.</p> - -<p>If no <var>formulae</var> are given, check all installed brews.</p></dd> <dt><code>migrate</code> [<code>--force</code>] <var>formulae</var></dt><dd><p>Migrate renamed packages to new name, where <var>formulae</var> are old names of packages.</p> <p>If <code>--force</code> is passed, then treat installed <var>formulae</var> and passed <var>formulae</var> like if they are from same taps and migrate them anyway.</p></dd> +<dt><code>missing</code> [<var>formulae</var>]</dt><dd><p>Check the given <var>formulae</var> for missing dependencies.</p> + +<p>If no <var>formulae</var> are given, check all installed brews.</p></dd> <dt><code>options</code> [<code>--compact</code>] (<code>--all</code>|<code>--installed</code>|<var>formulae</var>)</dt><dd><p>Display install options specific to <var>formulae</var>.</p> <p>If <code>--compact</code> is passed, show all options on a single line separated by @@ -274,10 +274,6 @@ <h2 id="COMMANDS">COMMANDS</h2> <p>If <code>--dry-run</code> or <code>-n</code> is passed, show what would be removed, but do not actually remove anything.</p></dd> <dt><code>reinstall</code> <var>formula</var></dt><dd><p>Uninstall then install <var>formula</var></p></dd> -<dt><code>rm</code>, <code>remove</code>, <code>uninstall</code> [<code>--force</code>] <var>formula</var></dt><dd><p>Uninstall <var>formula</var>.</p> - -<p>If <code>--force</code> is passed, and there are multiple versions of <var>formula</var> -installed, delete all installed versions.</p></dd> <dt><code>search</code>, <code>-S</code></dt><dd><p>Display all locally available formulae for brewing (including tapped ones). No online search is performed if called without arguments.</p></dd> <dt><code>search</code>, <code>-S</code> <var>text</var>|<code>/</code><var>text</var><code>/</code></dt><dd><p>Perform a substring search of formula names for <var>text</var>. If <var>text</var> is @@ -336,6 +332,10 @@ <h2 id="COMMANDS">COMMANDS</h2> launched with access to IRB or a shell inside the temporary test directory.</p> <p>Example: <code>brew install jruby &amp;&amp; brew test jruby</code></p></dd> +<dt><code>uninstall</code>, <code>rm</code>, <code>remove</code> [<code>--force</code>] <var>formula</var></dt><dd><p>Uninstall <var>formula</var>.</p> + +<p>If <code>--force</code> is passed, and there are multiple versions of <var>formula</var> +installed, delete all installed versions.</p></dd> <dt><code>unlink</code> [<code>--dry-run</code>] <var>formula</var></dt><dd><p>Remove symlinks for <var>formula</var> from the Homebrew prefix. This can be useful for temporarily disabling a formula: <code>brew unlink foo &amp;&amp; commands &amp;&amp; brew link foo</code>.</p>
true
Other
Homebrew
brew
c8a2cd4e10e6ea1d4e10531fbbc1ef10b0741815.json
Generate the new man page
share/man/man1/brew.1
@@ -295,15 +295,15 @@ If no \fIformulae\fR are provided, all of them will have their apps symlinked\. If provided, \fB\-\-local\fR will symlink them into the user\'s \fB~/Applications\fR directory instead of the system directory\. . .TP -\fBls\fR, \fBlist\fR [\fB\-\-full\-name\fR] +\fBlist\fR, \fBls\fR [\fB\-\-full\-name\fR] List all installed formulae\. If \fB\-\-full\-name\fR is passed, print formulae with full\-qualified names\. . .TP -\fBls\fR, \fBlist\fR \fB\-\-unbrewed\fR +\fBlist\fR, \fBls\fR \fB\-\-unbrewed\fR List all files in the Homebrew prefix not installed by Homebrew\. . .TP -\fBls\fR, \fBlist\fR [\fB\-\-versions\fR [\fB\-\-multiple\fR]] [\fB\-\-pinned\fR] [\fIformulae\fR] +\fBlist\fR, \fBls\fR [\fB\-\-versions\fR [\fB\-\-multiple\fR]] [\fB\-\-pinned\fR] [\fIformulae\fR] List the installed files for \fIformulae\fR\. Combined with \fB\-\-verbose\fR, recursively list the contents of all subdirectories in each \fIformula\fR\'s keg\. . .IP @@ -317,18 +317,18 @@ If \fB\-\-pinned\fR is passed, show the versions of pinned formulae, or only the Show the git log for the given formulae\. Options that \fBgit\-log\fR(1) recognizes can be passed before the formula list\. . .TP -\fBmissing\fR [\fIformulae\fR] -Check the given \fIformulae\fR for missing dependencies\. +\fBmigrate\fR [\fB\-\-force\fR] \fIformulae\fR +Migrate renamed packages to new name, where \fIformulae\fR are old names of packages\. . .IP -If no \fIformulae\fR are given, check all installed brews\. +If \fB\-\-force\fR is passed, then treat installed \fIformulae\fR and passed \fIformulae\fR like if they are from same taps and migrate them anyway\. . .TP -\fBmigrate\fR [\fB\-\-force\fR] \fIformulae\fR -Migrate renamed packages to new name, where \fIformulae\fR are old names of packages\. +\fBmissing\fR [\fIformulae\fR] +Check the given \fIformulae\fR for missing dependencies\. . .IP -If \fB\-\-force\fR is passed, then treat installed \fIformulae\fR and passed \fIformulae\fR like if they are from same taps and migrate them anyway\. +If no \fIformulae\fR are given, check all installed brews\. . .TP \fBoptions\fR [\fB\-\-compact\fR] (\fB\-\-all\fR|\fB\-\-installed\fR|\fIformulae\fR) @@ -375,13 +375,6 @@ If \fB\-\-dry\-run\fR or \fB\-n\fR is passed, show what would be removed, but do Uninstall then install \fIformula\fR . .TP -\fBrm\fR, \fBremove\fR, \fBuninstall\fR [\fB\-\-force\fR] \fIformula\fR -Uninstall \fIformula\fR\. -. -.IP -If \fB\-\-force\fR is passed, and there are multiple versions of \fIformula\fR installed, delete all installed versions\. -. -.TP \fBsearch\fR, \fB\-S\fR Display all locally available formulae for brewing (including tapped ones)\. No online search is performed if called without arguments\. . @@ -469,6 +462,13 @@ If \fB\-\-debug\fR is passed and the test fails, an interactive debugger will be Example: \fBbrew install jruby && brew test jruby\fR . .TP +\fBuninstall\fR, \fBrm\fR, \fBremove\fR [\fB\-\-force\fR] \fIformula\fR +Uninstall \fIformula\fR\. +. +.IP +If \fB\-\-force\fR is passed, and there are multiple versions of \fIformula\fR installed, delete all installed versions\. +. +.TP \fBunlink\fR [\fB\-\-dry\-run\fR] \fIformula\fR Remove symlinks for \fIformula\fR from the Homebrew prefix\. This can be useful for temporarily disabling a formula: \fBbrew unlink foo && commands && brew link foo\fR\. .
true
Other
Homebrew
brew
b21f699ff2f1691c4f10422c640a9d392cf2d7a7.json
Implement the `brew help` command This is also used by `brew <cmd> --help`. The basic idea is to have the documentation as a top level comment in each command file. To find these comments, they have to be like this `#:`. This is also used by the `brew man` command to keep the documentation DRY, and for that there are now a header and footer for the man page.
Library/Homebrew/cmd/help.rb
@@ -39,4 +39,23 @@ def help def help_s HOMEBREW_HELP end + + def help_for_command(cmd) + cmd_path = if File.exist?(HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.sh") + HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.sh" + elsif ARGV.homebrew_developer? && File.exist?(HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.sh") + HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.sh" + elsif File.exist?(HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb") + HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb" + elsif ARGV.homebrew_developer? && File.exist?(HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb") + HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb" + end + return if cmd_path.nil? + + cmd_path.read. + split("\n"). + grep(/^#:/). + map { |line| line.slice(2..-1).delete("`").sub(/^ \* /, "brew ") }. + join("\n") + end end
true
Other
Homebrew
brew
b21f699ff2f1691c4f10422c640a9d392cf2d7a7.json
Implement the `brew help` command This is also used by `brew <cmd> --help`. The basic idea is to have the documentation as a top level comment in each command file. To find these comments, they have to be like this `#:`. This is also used by the `brew man` command to keep the documentation DRY, and for that there are now a header and footer for the man page.
Library/Homebrew/cmd/man.rb
@@ -25,21 +25,35 @@ def man puts "Writing HTML fragments to #{DOC_PATH}" puts "Writing manpages to #{TARGET_PATH}" - Dir["#{SOURCE_PATH}/*.md"].each do |source_file| - args = %W[ - --pipe - --organization=Homebrew - --manual=brew - #{source_file} - ] - page = File.basename(source_file, ".md") - - target_html = DOC_PATH/"#{page}.html" - target_html.atomic_write Utils.popen_read("ronn", "--fragment", *args) - - target_man = TARGET_PATH/page - target_man.atomic_write Utils.popen_read("ronn", "--roff", *args) - end + header = (SOURCE_PATH/"header.1.md").read + footer = (SOURCE_PATH/"footer.1.md").read + sub_commands = Pathname.glob("#{HOMEBREW_LIBRARY_PATH}/cmd/*.{rb,sh}"). + sort_by { |source_file| source_file.basename.sub(/\.(rb|sh)$/, "") }. + map { |source_file| + source_file.read. + split("\n"). + grep(/^#:/). + map { |line| line.slice(2..-1) }. + join("\n") + }. + reject { |s| s.strip.empty? }. + join("\n\n") + + target_md = SOURCE_PATH/"brew.1.md" + target_md.atomic_write(header + sub_commands + footer) + + args = %W[ + --pipe + --organization=Homebrew + --manual=brew + #{SOURCE_PATH}/brew.1.md + ] + + target_html = DOC_PATH/"brew.1.html" + target_html.atomic_write Utils.popen_read("ronn", "--fragment", *args) + + target_man = TARGET_PATH/"brew.1" + target_man.atomic_write Utils.popen_read("ronn", "--roff", *args) end end end
true
Other
Homebrew
brew
b21f699ff2f1691c4f10422c640a9d392cf2d7a7.json
Implement the `brew help` command This is also used by `brew <cmd> --help`. The basic idea is to have the documentation as a top level comment in each command file. To find these comments, they have to be like this `#:`. This is also used by the `brew man` command to keep the documentation DRY, and for that there are now a header and footer for the man page.
Library/Homebrew/cmd/update.sh
@@ -220,8 +220,7 @@ homebrew-update() { for option in "$@" do case "$option" in - # TODO: - `brew update --help` should display update subcommand help - --help) brew --help; exit $? ;; + --help) brew help update; exit $? ;; --verbose) HOMEBREW_VERBOSE=1 ;; --debug) HOMEBREW_DEBUG=1;; --rebase) HOMEBREW_REBASE=1 ;;
true
Other
Homebrew
brew
b21f699ff2f1691c4f10422c640a9d392cf2d7a7.json
Implement the `brew help` command This is also used by `brew <cmd> --help`. The basic idea is to have the documentation as a top level comment in each command file. To find these comments, they have to be like this `#:`. This is also used by the `brew man` command to keep the documentation DRY, and for that there are now a header and footer for the man page.
Library/brew.rb
@@ -69,15 +69,27 @@ def require?(path) # It should never affect external commands so they can handle usage # arguments themselves. - if empty_argv || (help_flag && (cmd.nil? || internal_cmd)) - # TODO: - `brew help cmd` should display subcommand help - require "cmd/help" - if empty_argv - $stderr.puts ARGV.usage - else + if empty_argv + $stderr.puts ARGV.usage + exit 1 + elsif help_flag + if cmd.nil? puts ARGV.usage + exit 0 + else + # Handle both internal ruby and shell commands + require "cmd/help" + help_text = Homebrew.help_for_command(cmd) + if help_text.nil? + # External command, let it handle help by itself + elsif help_text.empty? + puts "No help available for #{cmd}" + exit 1 + else + puts help_text + exit 0 + end end - exit ARGV.any? ? 0 : 1 end if internal_cmd
true
Other
Homebrew
brew
b21f699ff2f1691c4f10422c640a9d392cf2d7a7.json
Implement the `brew help` command This is also used by `brew <cmd> --help`. The basic idea is to have the documentation as a top level comment in each command file. To find these comments, they have to be like this `#:`. This is also used by the `brew man` command to keep the documentation DRY, and for that there are now a header and footer for the man page.
Library/brew.sh
@@ -176,9 +176,9 @@ case "$HOMEBREW_COMMAND" in --config) HOMEBREW_COMMAND="config";; esac -if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]] ; then +if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]]; then HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" -elif [[ -n "$HOMEBREW_DEVELOPER" && -f "$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh" ]] ; then +elif [[ -n "$HOMEBREW_DEVELOPER" && -f "$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh" ]]; then HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh" fi
true
Other
Homebrew
brew
116075dda9c6c8bffe06e16646ed9eb4d0ae7f8e.json
Remove advice on bad Python linking This is pathological and something that should be fixed in core, not by working around it. Closes https://github.com/Homebrew/legacy-homebrew/pull/45704.
share/doc/homebrew/Common-Issues.md
@@ -95,49 +95,6 @@ $ git clean -n # if this doesn't list anything that you want to keep, then $ git clean -f # this will remove untracked files ``` -### Python: `Segmentation fault: 11` on `import <some_python_module>` - -A `Segmentation fault: 11` is in many cases due to a different Python -executable used for building the software vs. the python you use to import the -module. This can even happen when both python executables are the same version -(e.g. 2.7.2). The explanation is that Python packages with C extensions (those -that have `.so` files) are compiled against a certain python binary/library that -may have been built with a different arch (e.g. Apple's python is still not a -pure 64-bit build). Other things can go wrong, too. Welcome to the dirty -underworld of C. - -To solve this, you should remove the problematic formula with those python -bindings and all of its dependencies. - - - `brew rm $(brew deps --installed <problematic_formula>)` - - `brew rm <problematic_formula>` - - Also check the `$(brew --prefix)/lib/python2.7/site-packages` directory and - delete all remains of the corresponding python modules if they were not - cleanly removed by the previous steps. - - Check that `which python` points to the python you want. Perhaps now is the - time to `brew install python`. - - Then reinstall `brew install <problematic_formula>` - - Now start `python` and try to `import` the module installed by the - \<problematic_formula\> - -You can basically use any Python (2.x) for the bindings homebrew provides, but -you can't mix. Homebrew formulae use a brewed Python if available or, if not -so, they use whatever `python` is in your `PATH`. - -### Python: `Fatal Python error: PyThreadState_Get: no current thread` - -``` -Fatal Python error: PyThreadState_Get: no current thread -Abort trap: 6 -``` - -This happens for `boost-python`, `pygtk`, `pygobject`, and related modules, -for the same reason as described above. To solve this, follow the steps above. - -If `boost` is your problem, note that Boost.Python is now provided by the -`boost-python` formula. Removing any existing `boost` and `boost-python`, -running `brew update`, and installing them anew should fix things. - ### Python: easy-install.pth cannot be linked ``` Warning: Could not link <formulaname>. Unlinking...
false
Other
Homebrew
brew
eb137dc9248cf3b975b35fae2226c45d3dd9a0ab.json
Revert "diagnostic: improve check for 'install_name_tool'" This reverts commit 9f79c05656a44f926898774c6029025002bcd621. Restore check to continue to inspect `/usr/bin/install_name_tool`. See Homebrew/legacy-homebrew#50091 and Homebrew/legacy-homebrew#50509 for the full context and more details.
Library/Homebrew/diagnostic.rb
@@ -466,15 +466,13 @@ def check_for_stray_developer_directory def check_for_bad_install_name_tool return if MacOS.version < "10.9" - install_name_tool = OS::Mac.install_name_tool - libs = Pathname.new(install_name_tool).dynamically_linked_libraries + libs = Pathname.new("/usr/bin/install_name_tool").dynamically_linked_libraries # otool may not work, for example if the Xcode license hasn't been accepted yet return if libs.empty? - expectedLibs = ["/usr/lib/libSystem.B.dylib", "/usr/lib/libxcselect.dylib"] - if (libs & expectedLibs).empty? then <<-EOS.undent - You have an outdated version of #{install_name_tool} installed. + unless libs.include? "/usr/lib/libxcselect.dylib" then <<-EOS.undent + You have an outdated version of /usr/bin/install_name_tool installed. This will cause binary package installations to fail. This can happen if you install osx-gcc-installer or RailsInstaller. To restore it, you must reinstall OS X or restore the binary from
false
Other
Homebrew
brew
1d9977b7c1954ee80407f23e85cb4eafe326fd6d.json
diagnostic: prefer guard clauses for readability Guard clauses instead of if/unless blocks make the checks easier to understand and reduce nesting, thus improving overall readability. This includes the following additional minor changes: - Make indentation of commands consistent inside diagnostic messages. - Fix minor typos and inconsistent punctuation in diagnostic messages. - Fix here documents to always start with `<<-EOS.undent` on a new line, followed by the message (indented once), followed by `EOS` (at the same level like `<<-EOS.undent`). - Always separate the check logic (and guard clauses) from the following message by a single empty line (for consistency and readability). - Standardize on `message` as the variable name when diagnostic messages need to be constructed from multiple parts. - Where easily possible, adapt check logic to stay within 80-column limit, use more expressive variable names, and break down long expressions into multiple statements with intermediate results. Closes #49. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Library/Homebrew/diagnostic.rb
@@ -102,8 +102,10 @@ def send(method, *) # See https://github.com/Homebrew/homebrew/pull/9986 def check_path_for_trailing_slashes - bad_paths = ENV["PATH"].split(File::PATH_SEPARATOR).select { |p| p[-1..-1] == "/" } + all_paths = ENV["PATH"].split(File::PATH_SEPARATOR) + bad_paths = all_paths.select { |p| p[-1..-1] == "/" } return if bad_paths.empty? + inject_file_list bad_paths, <<-EOS.undent Some directories in your path end in a slash. Directories in your path should not end in a slash. This can break other @@ -121,13 +123,13 @@ def check_for_macgpg2 /Library/Receipts/libiconv1.pkg /usr/local/MacGPG2 ] + return unless suspects.any? { |f| File.exist? f } - if suspects.any? { |f| File.exist? f } then <<-EOS.undent + <<-EOS.undent You may have installed MacGPG2 via the package installer. Several other checks in this script will turn up problems, such as stray dylibs in /usr/local and permissions issues with share and man in /usr/local/. EOS - end end # Anaconda installs multiple system & brew dupes, including OpenSSL, Python, @@ -138,12 +140,14 @@ def check_for_anaconda return unless which("anaconda") return unless which("python") - anaconda = which("anaconda").realpath.dirname + anaconda_directory = which("anaconda").realpath.dirname python_binary = Utils.popen_read which("python"), "-c", "import sys; sys.stdout.write(sys.executable)" - python = Pathname.new(python_binary).realpath.dirname + python_directory = Pathname.new(python_binary).realpath.dirname # Only warn if Python lives with Anaconda, since is most problematic case. - if python == anaconda then <<-EOS.undent + return unless python_directory == anaconda_directory + + <<-EOS.undent Anaconda is known to frequently break Homebrew builds, including Vim and MacVim, due to bundling many duplicates of system and Homebrew-available tools. @@ -152,7 +156,6 @@ def check_for_anaconda from your $PATH and attempt the build again prior to reporting the failure to us. Thanks! EOS - end end def __check_stray_files(dir, pattern, white_list, message) @@ -161,8 +164,9 @@ def __check_stray_files(dir, pattern, white_list, message) files = Dir.chdir(dir) do Dir[pattern].select { |f| File.file?(f) && !File.symlink?(f) } - Dir.glob(white_list) end.map { |file| File.join(dir, file) } + return if files.empty? - inject_file_list(files, message) unless files.empty? + inject_file_list(files, message) end def check_for_stray_dylibs @@ -185,12 +189,12 @@ def check_for_stray_dylibs ] __check_stray_files "/usr/local/lib", "*.dylib", white_list, <<-EOS.undent - Unbrewed dylibs were found in /usr/local/lib. - If you didn't put them there on purpose they could cause problems when - building Homebrew formulae, and may need to be deleted. + Unbrewed dylibs were found in /usr/local/lib. + If you didn't put them there on purpose they could cause problems when + building Homebrew formulae, and may need to be deleted. - Unexpected dylibs: - EOS + Unexpected dylibs: + EOS end def check_for_stray_static_libs @@ -205,12 +209,12 @@ def check_for_stray_static_libs ] __check_stray_files "/usr/local/lib", "*.a", white_list, <<-EOS.undent - Unbrewed static libraries were found in /usr/local/lib. - If you didn't put them there on purpose they could cause problems when - building Homebrew formulae, and may need to be deleted. + Unbrewed static libraries were found in /usr/local/lib. + If you didn't put them there on purpose they could cause problems when + building Homebrew formulae, and may need to be deleted. - Unexpected static libraries: - EOS + Unexpected static libraries: + EOS end def check_for_stray_pcs @@ -225,12 +229,12 @@ def check_for_stray_pcs ] __check_stray_files "/usr/local/lib/pkgconfig", "*.pc", white_list, <<-EOS.undent - Unbrewed .pc files were found in /usr/local/lib/pkgconfig. - If you didn't put them there on purpose they could cause problems when - building Homebrew formulae, and may need to be deleted. + Unbrewed .pc files were found in /usr/local/lib/pkgconfig. + If you didn't put them there on purpose they could cause problems when + building Homebrew formulae, and may need to be deleted. - Unexpected .pc files: - EOS + Unexpected .pc files: + EOS end def check_for_stray_las @@ -246,12 +250,12 @@ def check_for_stray_las ] __check_stray_files "/usr/local/lib", "*.la", white_list, <<-EOS.undent - Unbrewed .la files were found in /usr/local/lib. - If you didn't put them there on purpose they could cause problems when - building Homebrew formulae, and may need to be deleted. + Unbrewed .la files were found in /usr/local/lib. + If you didn't put them there on purpose they could cause problems when + building Homebrew formulae, and may need to be deleted. - Unexpected .la files: - EOS + Unexpected .la files: + EOS end def check_for_stray_headers @@ -265,18 +269,19 @@ def check_for_stray_headers ] __check_stray_files "/usr/local/include", "**/*.h", white_list, <<-EOS.undent - Unbrewed header files were found in /usr/local/include. - If you didn't put them there on purpose they could cause problems when - building Homebrew formulae, and may need to be deleted. + Unbrewed header files were found in /usr/local/include. + If you didn't put them there on purpose they could cause problems when + building Homebrew formulae, and may need to be deleted. - Unexpected header files: - EOS + Unexpected header files: + EOS end def check_for_other_package_managers ponk = MacOS.macports_or_fink - unless ponk.empty? - <<-EOS.undent + return if ponk.empty? + + <<-EOS.undent You have MacPorts or Fink installed: #{ponk.join(", ")} @@ -285,7 +290,6 @@ def check_for_other_package_managers sudo mv /opt/local ~/macports EOS - end end def check_for_broken_symlinks @@ -300,155 +304,163 @@ def check_for_broken_symlinks end end return if broken_symlinks.empty? + inject_file_list broken_symlinks, <<-EOS.undent - Broken symlinks were found. Remove them with `brew prune`: + Broken symlinks were found. Remove them with `brew prune`: EOS end def check_for_unsupported_osx return if ARGV.homebrew_developer? + + who = "We" if OS::Mac.prerelease? - <<-EOS.undent - You are using OS X #{MacOS.version}. - We do not provide support for this pre-release version. - You may encounter build failures or other breakages. - EOS + what = "pre-release version" elsif OS::Mac.outdated_release? - <<-EOS.undent - You are using OS X #{MacOS.version}. - We (and Apple) do not provide support for this old version. - You may encounter build failures or other breakages. - EOS + who << " (and Apple)" + what = "old version" + else + return end + + <<-EOS.undent + You are using OS X #{MacOS.version}. + #{who} do not provide support for this #{what}. + You may encounter build failures or other breakages. + EOS end # TODO: distill down into single method definition a la BuildToolsError if MacOS.version >= "10.9" def check_for_installed_developer_tools - unless MacOS::Xcode.installed? || MacOS::CLT.installed? then <<-EOS.undent - No developer tools installed. - Install the Command Line Tools: - xcode-select --install + return if MacOS::Xcode.installed? || MacOS::CLT.installed? + + <<-EOS.undent + No developer tools installed. + Install the Command Line Tools: + xcode-select --install EOS - end end if OS::Mac.prerelease? def check_xcode_up_to_date - if MacOS::Xcode.installed? && MacOS::Xcode.outdated? - <<-EOS.undent - Your Xcode (#{MacOS::Xcode.version}) is outdated - Please update to Xcode #{MacOS::Xcode.latest_version}. - Xcode can be updated from - https://developer.apple.com/xcode/downloads/ + return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated? + + <<-EOS.undent + Your Xcode (#{MacOS::Xcode.version}) is outdated + Please update to Xcode #{MacOS::Xcode.latest_version}. + Xcode can be updated from + https://developer.apple.com/xcode/downloads/ EOS - end end else def check_xcode_up_to_date - if MacOS::Xcode.installed? && MacOS::Xcode.outdated? - <<-EOS.undent - Your Xcode (#{MacOS::Xcode.version}) is outdated - Please update to Xcode #{MacOS::Xcode.latest_version}. - Xcode can be updated from the App Store. + return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated? + + <<-EOS.undent + Your Xcode (#{MacOS::Xcode.version}) is outdated + Please update to Xcode #{MacOS::Xcode.latest_version}. + Xcode can be updated from the App Store. EOS - end end end def check_clt_up_to_date - if MacOS::CLT.installed? && MacOS::CLT.outdated? then <<-EOS.undent - A newer Command Line Tools release is available. - Update them from Software Update in the App Store. + return unless MacOS::CLT.installed? && MacOS::CLT.outdated? + + <<-EOS.undent + A newer Command Line Tools release is available. + Update them from Software Update in the App Store. EOS - end end elsif MacOS.version == "10.8" || MacOS.version == "10.7" def check_for_installed_developer_tools - unless MacOS::Xcode.installed? || MacOS::CLT.installed? then <<-EOS.undent - No developer tools installed. - You should install the Command Line Tools. - The standalone package can be obtained from - https://developer.apple.com/downloads - or it can be installed via Xcode's preferences. + return if MacOS::Xcode.installed? || MacOS::CLT.installed? + + <<-EOS.undent + No developer tools installed. + You should install the Command Line Tools. + The standalone package can be obtained from + https://developer.apple.com/downloads + or it can be installed via Xcode's preferences. EOS - end end def check_xcode_up_to_date - if MacOS::Xcode.installed? && MacOS::Xcode.outdated? then <<-EOS.undent - Your Xcode (#{MacOS::Xcode.version}) is outdated - Please update to Xcode #{MacOS::Xcode.latest_version}. - Xcode can be updated from - https://developer.apple.com/xcode/downloads/ + return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated? + + <<-EOS.undent + Your Xcode (#{MacOS::Xcode.version}) is outdated + Please update to Xcode #{MacOS::Xcode.latest_version}. + Xcode can be updated from + https://developer.apple.com/xcode/downloads/ EOS - end end def check_clt_up_to_date - if MacOS::CLT.installed? && MacOS::CLT.outdated? then <<-EOS.undent - A newer Command Line Tools release is available. - The standalone package can be obtained from - https://developer.apple.com/downloads - or it can be installed via Xcode's preferences. + return unless MacOS::CLT.installed? && MacOS::CLT.outdated? + + <<-EOS.undent + A newer Command Line Tools release is available. + The standalone package can be obtained from + https://developer.apple.com/downloads + or it can be installed via Xcode's preferences. EOS - end end else def check_for_installed_developer_tools - unless MacOS::Xcode.installed? then <<-EOS.undent - Xcode is not installed. Most formulae need Xcode to build. - It can be installed from - https://developer.apple.com/xcode/downloads/ + return if MacOS::Xcode.installed? + + <<-EOS.undent + Xcode is not installed. Most formulae need Xcode to build. + It can be installed from + https://developer.apple.com/xcode/downloads/ EOS - end end def check_xcode_up_to_date - if MacOS::Xcode.installed? && MacOS::Xcode.outdated? then <<-EOS.undent - Your Xcode (#{MacOS::Xcode.version}) is outdated - Please update to Xcode #{MacOS::Xcode.latest_version}. - Xcode can be updated from - https://developer.apple.com/xcode/downloads/ + return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated? + + <<-EOS.undent + Your Xcode (#{MacOS::Xcode.version}) is outdated + Please update to Xcode #{MacOS::Xcode.latest_version}. + Xcode can be updated from + https://developer.apple.com/xcode/downloads/ EOS - end end end def check_for_osx_gcc_installer - if (MacOS.version < "10.7" || MacOS::Xcode.version > "4.1") && \ - MacOS.clang_version == "2.1" - message = <<-EOS.undent - You seem to have osx-gcc-installer installed. - Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and - is an unlicensed distribution of really old Xcode files. - EOS - if MacOS.version >= :mavericks - message += <<-EOS.undent - Please run `xcode-select --install` to install the CLT. - EOS - elsif MacOS.version >= :lion - message += <<-EOS.undent - Please install the CLT or Xcode #{MacOS::Xcode.latest_version}. - EOS - else - message += <<-EOS.undent - Please install Xcode #{MacOS::Xcode.latest_version}. - EOS - end + return unless MacOS.version < "10.7" || MacOS::Xcode.version > "4.1" + return unless MacOS.clang_version == "2.1" + + fix_advice = if MacOS.version >= :mavericks + "Please run `xcode-select --install` to install the CLT." + elsif MacOS.version >= :lion + "Please install the CLT or Xcode #{MacOS::Xcode.latest_version}." + else + "Please install Xcode #{MacOS::Xcode.latest_version}." end + + <<-EOS.undent + You seem to have osx-gcc-installer installed. + Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and + is an unlicensed distribution of really old Xcode files. + #{fix_advice} + EOS end def check_for_stray_developer_directory # if the uninstaller script isn't there, it's a good guess neither are # any troublesome leftover Xcode files uninstaller = Pathname.new("/Developer/Library/uninstall-developer-folder") - if MacOS::Xcode.version >= "4.3" && uninstaller.exist? then <<-EOS.undent - You have leftover files from an older version of Xcode. - You should delete them using: - #{uninstaller} + return unless MacOS::Xcode.version >= "4.3" && uninstaller.exist? + + <<-EOS.undent + You have leftover files from an older version of Xcode. + You should delete them using: + #{uninstaller} EOS - end end def check_for_bad_install_name_tool @@ -476,13 +488,12 @@ def __check_subdir_access(base) return unless target.exist? cant_read = [] - target.find do |d| next unless d.directory? cant_read << d unless d.writable_real? end - return if cant_read.empty? + inject_file_list cant_read.sort, <<-EOS.undent Some directories in #{target} aren't writable. This can happen if you "sudo make install" software that isn't managed @@ -502,72 +513,78 @@ def check_access_share_man end def check_access_homebrew_repository - unless HOMEBREW_REPOSITORY.writable_real? then <<-EOS.undent + return if HOMEBREW_REPOSITORY.writable_real? + + <<-EOS.undent #{HOMEBREW_REPOSITORY} is not writable. You should probably change the ownership and permissions of #{HOMEBREW_REPOSITORY} back to your user account. sudo chown -R $(whoami) #{HOMEBREW_REPOSITORY} EOS - end end def check_access_usr_local return unless HOMEBREW_PREFIX.to_s == "/usr/local" + return if HOMEBREW_PREFIX.writable_real? - unless HOMEBREW_PREFIX.writable_real? then <<-EOS.undent - /usr/local is not writable. - Even if this directory was writable when you installed Homebrew, other - software may change permissions on this directory. For example, upgrading - to OS X El Capitan has been known to do this. Some versions of the - "InstantOn" component of Airfoil or running Cocktail cleanup/optimizations - are known to do this as well. - - You should probably change the ownership and permissions of /usr/local - back to your user account. - sudo chown -R $(whoami) /usr/local + <<-EOS.undent + /usr/local is not writable. + Even if this directory was writable when you installed Homebrew, other + software may change permissions on this directory. For example, upgrading + to OS X El Capitan has been known to do this. Some versions of the + "InstantOn" component of Airfoil or running Cocktail cleanup/optimizations + are known to do this as well. + + You should probably change the ownership and permissions of /usr/local + back to your user account. + sudo chown -R $(whoami) /usr/local EOS - end end def check_tmpdir_sticky_bit - # Repair Disk Permissions was removed(?) in El Capitan. + world_writable = HOMEBREW_TEMP.stat.mode & 0777 == 0777 + return if !world_writable || HOMEBREW_TEMP.sticky? + + # Repair Disk Permissions was removed in El Capitan. # https://support.apple.com/en-us/HT201560 - if MacOS.version < "10.11" - fix_message = "Please run \"Repair Disk Permissions\" in Disk Utility." + fix_advice = if MacOS.version < "10.11" + "Please run \"Repair Disk Permissions\" in Disk Utility." else - fix_message = "Please execute `sudo chmod +t #{HOMEBREW_TEMP}` in your Terminal" + "Please execute `sudo chmod +t #{HOMEBREW_TEMP}` in your Terminal." end - world_writable = HOMEBREW_TEMP.stat.mode & 0777 == 0777 - if world_writable && !HOMEBREW_TEMP.sticky? then <<-EOS.undent - #{HOMEBREW_TEMP} is world-writable but does not have the sticky bit set. - #{fix_message} + <<-EOS.undent + #{HOMEBREW_TEMP} is world-writable but does not have the sticky bit set. + #{fix_advice} EOS - end end (Keg::TOP_LEVEL_DIRECTORIES + ["lib/pkgconfig"]).each do |d| define_method("check_access_#{d.sub("/", "_")}") do dir = HOMEBREW_PREFIX.join(d) - if dir.exist? && !dir.writable_real? then <<-EOS.undent - #{dir} isn't writable. + return unless dir.exist? + return if dir.writable_real? - This can happen if you "sudo make install" software that isn't managed - by Homebrew. If a formula tries to write a file to this directory, the - install will fail during the link step. + <<-EOS.undent + #{dir} isn't writable. - You should probably change the ownership and permissions of #{dir} - back to your user account. - sudo chown -R $(whoami) #{dir} + This can happen if you "sudo make install" software that isn't managed + by Homebrew. If a formula tries to write a file to this directory, the + install will fail during the link step. + + You should probably change the ownership and permissions of #{dir} + back to your user account. + sudo chown -R $(whoami) #{dir} EOS - end end end def check_access_site_packages - if Language::Python.homebrew_site_packages.exist? && !Language::Python.homebrew_site_packages.writable_real? - <<-EOS.undent + return unless Language::Python.homebrew_site_packages.exist? + return if Language::Python.homebrew_site_packages.writable_real? + + <<-EOS.undent #{Language::Python.homebrew_site_packages} isn't writable. This can happen if you "sudo pip install" software that isn't managed by Homebrew. If you install a formula with Python modules, the install @@ -577,25 +594,27 @@ def check_access_site_packages back to your user account. sudo chown -R $(whoami) #{Language::Python.homebrew_site_packages} EOS - end end def check_access_logs - if HOMEBREW_LOGS.exist? && !HOMEBREW_LOGS.writable_real? - <<-EOS.undent + return unless HOMEBREW_LOGS.exist? + return if HOMEBREW_LOGS.writable_real? + + <<-EOS.undent #{HOMEBREW_LOGS} isn't writable. Homebrew writes debugging logs to this location. You should probably change the ownership and permissions of #{HOMEBREW_LOGS} back to your user account. sudo chown -R $(whoami) #{HOMEBREW_LOGS} EOS - end end def check_access_cache - if HOMEBREW_CACHE.exist? && !HOMEBREW_CACHE.writable_real? - <<-EOS.undent + return unless HOMEBREW_CACHE.exist? + return if HOMEBREW_CACHE.writable_real? + + <<-EOS.undent #{HOMEBREW_CACHE} isn't writable. This can happen if you run `brew install` or `brew fetch` as another user. Homebrew caches downloaded files to this location. @@ -604,94 +623,97 @@ def check_access_cache back to your user account. sudo chown -R $(whoami) #{HOMEBREW_CACHE} EOS - end end def check_access_cellar - if HOMEBREW_CELLAR.exist? && !HOMEBREW_CELLAR.writable_real? - <<-EOS.undent + return unless HOMEBREW_CELLAR.exist? + return if HOMEBREW_CELLAR.writable_real? + + <<-EOS.undent #{HOMEBREW_CELLAR} isn't writable. You should probably change the ownership and permissions of #{HOMEBREW_CELLAR} back to your user account. sudo chown -R $(whoami) #{HOMEBREW_CELLAR} EOS - end end def check_access_prefix_opt opt = HOMEBREW_PREFIX.join("opt") - if opt.exist? && !opt.writable_real? - <<-EOS.undent + return unless opt.exist? + return if opt.writable_real? + + <<-EOS.undent #{opt} isn't writable. + You should probably change the ownership and permissions of #{opt} back to your user account. sudo chown -R $(whoami) #{opt} EOS - end end def check_ruby_version ruby_version = MacOS.version >= "10.9" ? "2.0" : "1.8" - if RUBY_VERSION[/\d\.\d/] != ruby_version then <<-EOS.undent - Ruby version #{RUBY_VERSION} is unsupported on #{MacOS.version}. Homebrew - is developed and tested on Ruby #{ruby_version}, and may not work correctly - on other Rubies. Patches are accepted as long as they don't cause breakage - on supported Rubies. + return if RUBY_VERSION[/\d\.\d/] == ruby_version + + <<-EOS.undent + Ruby version #{RUBY_VERSION} is unsupported on #{MacOS.version}. Homebrew + is developed and tested on Ruby #{ruby_version}, and may not work correctly + on other Rubies. Patches are accepted as long as they don't cause breakage + on supported Rubies. EOS - end end def check_homebrew_prefix - unless HOMEBREW_PREFIX.to_s == "/usr/local" - <<-EOS.undent + return if HOMEBREW_PREFIX.to_s == "/usr/local" + + <<-EOS.undent Your Homebrew is not installed to /usr/local You can install Homebrew anywhere you want, but some brews may only build correctly if you install in /usr/local. Sorry! EOS - end end def check_xcode_prefix prefix = MacOS::Xcode.prefix return if prefix.nil? - if prefix.to_s.match(" ") - <<-EOS.undent + return unless prefix.to_s.include?(" ") + + <<-EOS.undent Xcode is installed to a directory with a space in the name. This will cause some formulae to fail to build. EOS - end end def check_xcode_prefix_exists prefix = MacOS::Xcode.prefix - return if prefix.nil? - unless prefix.exist? - <<-EOS.undent + return if prefix.nil? || prefix.exist? + + <<-EOS.undent The directory Xcode is reportedly installed to doesn't exist: #{prefix} You may need to `xcode-select` the proper path if you have moved Xcode. EOS - end end def check_xcode_select_path - if !MacOS::CLT.installed? && !File.file?("#{MacOS.active_developer_dir}/usr/bin/xcodebuild") - path = MacOS::Xcode.bundle_path - path = "/Developer" if path.nil? || !path.directory? - <<-EOS.undent + return if MacOS::CLT.installed? + return if File.file?("#{MacOS.active_developer_dir}/usr/bin/xcodebuild") + + path = MacOS::Xcode.bundle_path + path = "/Developer" if path.nil? || !path.directory? + <<-EOS.undent Your Xcode is configured with an invalid path. You should change it to the correct path: sudo xcode-select -switch #{path} EOS - end end def check_user_path_1 $seen_prefix_bin = false $seen_prefix_sbin = false - out = nil + message = "" paths.each do |p| case p @@ -704,18 +726,18 @@ def check_user_path_1 select { |bn| File.exist? "/usr/bin/#{bn}" } if conflicts.size > 0 - out = inject_file_list conflicts, <<-EOS.undent - /usr/bin occurs before #{HOMEBREW_PREFIX}/bin - This means that system-provided programs will be used instead of those - provided by Homebrew. The following tools exist at both paths: + message = inject_file_list conflicts, <<-EOS.undent + /usr/bin occurs before #{HOMEBREW_PREFIX}/bin + This means that system-provided programs will be used instead of those + provided by Homebrew. The following tools exist at both paths: EOS - out += <<-EOS.undent + message += <<-EOS.undent - Consider setting your PATH so that #{HOMEBREW_PREFIX}/bin - occurs before /usr/bin. Here is a one-liner: + Consider setting your PATH so that #{HOMEBREW_PREFIX}/bin + occurs before /usr/bin. Here is a one-liner: echo 'export PATH="#{HOMEBREW_PREFIX}/bin:$PATH"' >> #{shell_profile} - EOS + EOS end end when "#{HOMEBREW_PREFIX}/bin" @@ -724,134 +746,146 @@ def check_user_path_1 $seen_prefix_sbin = true end end - out + + message unless message.empty? end def check_user_path_2 - unless $seen_prefix_bin - <<-EOS.undent + return if $seen_prefix_bin + + <<-EOS.undent Homebrew's bin was not found in your PATH. Consider setting the PATH for example like so - echo 'export PATH="#{HOMEBREW_PREFIX}/bin:$PATH"' >> #{shell_profile} + echo 'export PATH="#{HOMEBREW_PREFIX}/bin:$PATH"' >> #{shell_profile} EOS - end end def check_user_path_3 + return if $seen_prefix_sbin + # Don't complain about sbin not being in the path if it doesn't exist sbin = (HOMEBREW_PREFIX+"sbin") - if sbin.directory? && sbin.children.length > 0 - unless $seen_prefix_sbin - <<-EOS.undent - Homebrew's sbin was not found in your PATH but you have installed - formulae that put executables in #{HOMEBREW_PREFIX}/sbin. - Consider setting the PATH for example like so - echo 'export PATH="#{HOMEBREW_PREFIX}/sbin:$PATH"' >> #{shell_profile} - EOS - end - end + return unless sbin.directory? && sbin.children.length > 0 + + <<-EOS.undent + Homebrew's sbin was not found in your PATH but you have installed + formulae that put executables in #{HOMEBREW_PREFIX}/sbin. + Consider setting the PATH for example like so + echo 'export PATH="#{HOMEBREW_PREFIX}/sbin:$PATH"' >> #{shell_profile} + EOS end def check_for_bad_curl - if MacOS.version <= "10.8" && !Formula["curl"].installed? then <<-EOS.undent + return unless MacOS.version <= "10.8" + return if Formula["curl"].installed? + + <<-EOS.undent The system curl on 10.8 and below is often incapable of supporting modern secure connections & will fail on fetching formulae. We recommend you: brew install curl - EOS - end + EOS end def check_user_curlrc - if %w[CURL_HOME HOME].any? { |key| ENV[key] && File.exist?("#{ENV[key]}/.curlrc") } then <<-EOS.undent - You have a curlrc file - If you have trouble downloading packages with Homebrew, then maybe this - is the problem? If the following command doesn't work, then try removing - your curlrc: - curl https://github.com - EOS + curlrc_found = %w[CURL_HOME HOME].any? do |var| + ENV[var] && File.exist?("#{ENV[var]}/.curlrc") end + return unless curlrc_found + + <<-EOS.undent + You have a curlrc file + If you have trouble downloading packages with Homebrew, then maybe this + is the problem? If the following command doesn't work, then try removing + your curlrc: + curl https://github.com + EOS end def check_for_unsupported_curl_vars # Support for SSL_CERT_DIR seemed to be removed in the 10.10.5 update. - if MacOS.version >= :yosemite && !ENV["SSL_CERT_DIR"].nil? then <<-EOS.undent + return unless MacOS.version >= :yosemite + return if ENV["SSL_CERT_DIR"].nil? + + <<-EOS.undent SSL_CERT_DIR support was removed from Apple's curl. If fetching formulae fails you should: unset SSL_CERT_DIR and remove it from #{shell_profile} if present. - EOS - end + EOS end def check_which_pkg_config binary = which "pkg-config" return if binary.nil? mono_config = Pathname.new("/usr/bin/pkg-config") - if mono_config.exist? && mono_config.realpath.to_s.include?("Mono.framework") then <<-EOS.undent - You have a non-Homebrew 'pkg-config' in your PATH: - /usr/bin/pkg-config => #{mono_config.realpath} + if mono_config.exist? && mono_config.realpath.to_s.include?("Mono.framework") + <<-EOS.undent + You have a non-Homebrew 'pkg-config' in your PATH: + /usr/bin/pkg-config => #{mono_config.realpath} - This was most likely created by the Mono installer. `./configure` may - have problems finding brew-installed packages using this other pkg-config. + This was most likely created by the Mono installer. `./configure` may + have problems finding brew-installed packages using this other pkg-config. - Mono no longer installs this file as of 3.0.4. You should - `sudo rm /usr/bin/pkg-config` and upgrade to the latest version of Mono. - EOS - elsif binary.to_s != "#{HOMEBREW_PREFIX}/bin/pkg-config" then <<-EOS.undent - You have a non-Homebrew 'pkg-config' in your PATH: - #{binary} + Mono no longer installs this file as of 3.0.4. You should + `sudo rm /usr/bin/pkg-config` and upgrade to the latest version of Mono. + EOS + elsif binary.to_s != "#{HOMEBREW_PREFIX}/bin/pkg-config" + <<-EOS.undent + You have a non-Homebrew 'pkg-config' in your PATH: + #{binary} - `./configure` may have problems finding brew-installed packages using - this other pkg-config. - EOS + `./configure` may have problems finding brew-installed packages using + this other pkg-config. + EOS end end def check_for_gettext find_relative_paths("lib/libgettextlib.dylib", "lib/libintl.dylib", "include/libintl.h") - return if @found.empty? # Our gettext formula will be caught by check_linked_keg_only_brews - f = Formulary.factory("gettext") rescue nil - return if f && f.linked_keg.directory? && @found.all? do |path| + gettext = Formulary.factory("gettext") rescue nil + homebrew_owned = @found.all? do |path| Pathname.new(path).realpath.to_s.start_with? "#{HOMEBREW_CELLAR}/gettext" end + return if gettext && gettext.linked_keg.directory? && homebrew_owned - s = <<-EOS.undent_________________________________________________________72 - gettext files detected at a system prefix + inject_file_list @found, <<-EOS.undent + gettext files detected at a system prefix. These files can cause compilation and link failures, especially if they are compiled with improper architectures. Consider removing these files: - EOS - inject_file_list(@found, s) + EOS end def check_for_iconv - unless find_relative_paths("lib/libiconv.dylib", "include/iconv.h").empty? - if (f = Formulary.factory("libiconv") rescue nil) && f.linked_keg.directory? - unless f.keg_only? then <<-EOS.undent - A libiconv formula is installed and linked - This will break stuff. For serious. Unlink it. + find_relative_paths("lib/libiconv.dylib", "include/iconv.h") + return if @found.empty? + + libiconv = Formulary.factory("libiconv") rescue nil + if libiconv && libiconv.linked_keg.directory? + unless libiconv.keg_only? + <<-EOS.undent + A libiconv formula is installed and linked. + This will break stuff. For serious. Unlink it. EOS - end - else - s = <<-EOS.undent_________________________________________________________72 - libiconv files detected at a system prefix other than /usr - Homebrew doesn't provide a libiconv formula, and expects to link against - the system version in /usr. libiconv in other prefixes can cause - compile or link failure, especially if compiled with improper - architectures. OS X itself never installs anything to /usr/local so - it was either installed by a user or some other third party software. - - tl;dr: delete these files: - EOS - inject_file_list(@found, s) end + else + inject_file_list @found, <<-EOS.undent + libiconv files detected at a system prefix other than /usr. + Homebrew doesn't provide a libiconv formula, and expects to link against + the system version in /usr. libiconv in other prefixes can cause + compile or link failure, especially if compiled with improper + architectures. OS X itself never installs anything to /usr/local so + it was either installed by a user or some other third party software. + + tl;dr: delete these files: + EOS end end @@ -879,6 +913,7 @@ def check_for_config_scripts end return if scripts.empty? + inject_file_list scripts, <<-EOS.undent "config" scripts exist outside your system or Homebrew directories. `./configure` scripts often look for *-config scripts to determine if @@ -892,27 +927,32 @@ def check_for_config_scripts end def check_DYLD_vars - found = ENV.keys.grep(/^DYLD_/) - return if found.empty? - s = inject_file_list found.map { |e| "#{e}: #{ENV.fetch(e)}" }, <<-EOS.undent + dyld_vars = ENV.keys.grep(/^DYLD_/) + return if dyld_vars.empty? + + values = dyld_vars.map { |var| "#{var}: #{ENV.fetch(var)}" } + message = inject_file_list values, <<-EOS.undent Setting DYLD_* vars can break dynamic linking. Set variables: EOS - if found.include? "DYLD_INSERT_LIBRARIES" - s += <<-EOS.undent - Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail. - Having this set is common if you use this software: - http://asepsis.binaryage.com/ + if dyld_vars.include? "DYLD_INSERT_LIBRARIES" + message += <<-EOS.undent + + Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail. + Having this set is common if you use this software: + http://asepsis.binaryage.com/ EOS end - s + + message end def check_for_symlinked_cellar return unless HOMEBREW_CELLAR.exist? - if HOMEBREW_CELLAR.symlink? - <<-EOS.undent + return unless HOMEBREW_CELLAR.symlink? + + <<-EOS.undent Symlinked Cellars can cause problems. Your Homebrew Cellar is a symlink: #{HOMEBREW_CELLAR} which resolves to: #{HOMEBREW_CELLAR.realpath} @@ -925,7 +965,6 @@ def check_for_symlinked_cellar cause problems when two formula install to locations that are mapped on top of each other during the linking step. EOS - end end def check_for_multiple_volumes @@ -934,115 +973,131 @@ def check_for_multiple_volumes # Find the volumes for the TMP folder & HOMEBREW_CELLAR real_cellar = HOMEBREW_CELLAR.realpath - - tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP)) - real_temp = tmp.realpath.parent - where_cellar = volumes.which real_cellar - where_temp = volumes.which real_temp - Dir.delete tmp + tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP)) + begin + real_tmp = tmp.realpath.parent + where_tmp = volumes.which real_tmp + ensure + Dir.delete tmp + end + return if where_cellar == where_tmp - unless where_cellar == where_temp then <<-EOS.undent - Your Cellar and TEMP directories are on different volumes. - OS X won't move relative symlinks across volumes unless the target file already - exists. Brews known to be affected by this are Git and Narwhal. + <<-EOS.undent + Your Cellar and TEMP directories are on different volumes. + OS X won't move relative symlinks across volumes unless the target file already + exists. Brews known to be affected by this are Git and Narwhal. - You should set the "HOMEBREW_TEMP" environmental variable to a suitable - directory on the same volume as your Cellar. + You should set the "HOMEBREW_TEMP" environmental variable to a suitable + directory on the same volume as your Cellar. EOS - end end def check_filesystem_case_sensitive - volumes = Volumes.new - case_sensitive_vols = [HOMEBREW_PREFIX, HOMEBREW_REPOSITORY, HOMEBREW_CELLAR, HOMEBREW_TEMP].select do |dir| + dirs_to_check = [ + HOMEBREW_PREFIX, + HOMEBREW_REPOSITORY, + HOMEBREW_CELLAR, + HOMEBREW_TEMP, + ] + case_sensitive_dirs = dirs_to_check.select do |dir| # We select the dir as being case-sensitive if either the UPCASED or the # downcased variant is missing. # Of course, on a case-insensitive fs, both exist because the os reports so. # In the rare situation when the user has indeed a downcased and an upcased # dir (e.g. /TMP and /tmp) this check falsely thinks it is case-insensitive - # but we don't care beacuse: 1. there is more than one dir checked, 2. the + # but we don't care because: 1. there is more than one dir checked, 2. the # check is not vital and 3. we would have to touch files otherwise. upcased = Pathname.new(dir.to_s.upcase) downcased = Pathname.new(dir.to_s.downcase) dir.exist? && !(upcased.exist? && downcased.exist?) - end.map { |case_sensitive_dir| volumes.get_mounts(case_sensitive_dir) }.uniq - return if case_sensitive_vols.empty? + end + return if case_sensitive_dirs.empty? + + volumes = Volumes.new + case_sensitive_vols = case_sensitive_dirs.map do |case_sensitive_dir| + volumes.get_mounts(case_sensitive_dir) + end + case_sensitive_vols.uniq! + <<-EOS.undent - The filesystem on #{case_sensitive_vols.join(",")} appears to be case-sensitive. - The default OS X filesystem is case-insensitive. Please report any apparent problems. - EOS + The filesystem on #{case_sensitive_vols.join(",")} appears to be case-sensitive. + The default OS X filesystem is case-insensitive. Please report any apparent problems. + EOS end def __check_git_version # https://help.github.com/articles/https-cloning-errors `git --version`.chomp =~ /git version ((?:\d+\.?)+)/ + return unless $1 && Version.new($1) < Version.new("1.7.10") - if $1 && Version.new($1) < Version.new("1.7.10") - git_upgrade_cmd = Formula["git"].any_version_installed? ? "upgrade" : "install" - - <<-EOS.undent - An outdated version of Git was detected in your PATH. - Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub. - Please upgrade: brew #{git_upgrade_cmd} git - EOS - end + git = Formula["git"] + git_upgrade_cmd = git.any_version_installed? ? "upgrade" : "install" + <<-EOS.undent + An outdated version of Git was detected in your PATH. + Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub. + Please upgrade: + brew #{git_upgrade_cmd} git + EOS end def check_for_git if Utils.git_available? __check_git_version - else <<-EOS.undent - Git could not be found in your PATH. - Homebrew uses Git for several internal functions, and some formulae use Git - checkouts instead of stable tarballs. You may want to install Git: - brew install git - EOS + else + <<-EOS.undent + Git could not be found in your PATH. + Homebrew uses Git for several internal functions, and some formulae use Git + checkouts instead of stable tarballs. You may want to install Git: + brew install git + EOS end end def check_git_newline_settings return unless Utils.git_available? autocrlf = HOMEBREW_REPOSITORY.cd { `git config --get core.autocrlf`.chomp } + return unless autocrlf == "true" - if autocrlf == "true" then <<-EOS.undent - Suspicious Git newline settings found. + <<-EOS.undent + Suspicious Git newline settings found. - The detected Git newline settings will cause checkout problems: - core.autocrlf = #{autocrlf} + The detected Git newline settings will cause checkout problems: + core.autocrlf = #{autocrlf} - If you are not routinely dealing with Windows-based projects, - consider removing these by running: - `git config --global core.autocrlf input` + If you are not routinely dealing with Windows-based projects, + consider removing these by running: + git config --global core.autocrlf input EOS - end end def check_git_origin return if !Utils.git_available? || !(HOMEBREW_REPOSITORY/".git").exist? origin = Homebrew.git_origin - if origin.nil? then <<-EOS.undent - Missing git origin remote. + if origin.nil? + <<-EOS.undent + Missing git origin remote. - Without a correctly configured origin, Homebrew won't update - properly. You can solve this by adding the Homebrew remote: - cd #{HOMEBREW_REPOSITORY} - git remote add origin https://github.com/Homebrew/brew.git + Without a correctly configured origin, Homebrew won't update + properly. You can solve this by adding the Homebrew remote: + cd #{HOMEBREW_REPOSITORY} + git remote add origin https://github.com/Homebrew/brew.git EOS - elsif origin !~ /Homebrew\/brew(\.git)?$/ then <<-EOS.undent - Suspicious git origin remote found. + elsif origin !~ /Homebrew\/brew(\.git)?$/ + <<-EOS.undent + Suspicious git origin remote found. - With a non-standard origin, Homebrew won't pull updates from - the main repository. The current git origin is: - #{origin} + With a non-standard origin, Homebrew won't pull updates from + the main repository. The current git origin is: + #{origin} - Unless you have compelling reasons, consider setting the - origin remote to point at the main repository, located at: - https://github.com/Homebrew/brew.git + Unless you have compelling reasons, consider setting the + origin remote to point at the main repository, located at: + https://github.com/Homebrew/brew.git EOS end end @@ -1053,13 +1108,14 @@ def check_for_autoconf autoconf = which("autoconf") safe_autoconfs = %w[/usr/bin/autoconf /Developer/usr/bin/autoconf] - unless autoconf.nil? || safe_autoconfs.include?(autoconf.to_s) then <<-EOS.undent - An "autoconf" in your path blocks the Xcode-provided version at: - #{autoconf} + return if autoconf.nil? || safe_autoconfs.include?(autoconf.to_s) - This custom autoconf may cause some Homebrew formulae to fail to compile. + <<-EOS.undent + An "autoconf" in your path blocks the Xcode-provided version at: + #{autoconf} + + This custom autoconf may cause some Homebrew formulae to fail to compile. EOS - end end def __check_linked_brew(f) @@ -1080,39 +1136,48 @@ def check_for_linked_keg_only_brews linked = Formula.installed.select do |f| f.keg_only? && __check_linked_brew(f) end - return if linked.empty? + inject_file_list linked.map(&:full_name), <<-EOS.undent - Some keg-only formula are linked into the Cellar. - Linking a keg-only formula, such as gettext, into the cellar with - `brew link <formula>` will cause other formulae to detect them during - the `./configure` step. This may cause problems when compiling those - other formulae. + Some keg-only formula are linked into the Cellar. + Linking a keg-only formula, such as gettext, into the cellar with + `brew link <formula>` will cause other formulae to detect them during + the `./configure` step. This may cause problems when compiling those + other formulae. - Binaries provided by keg-only formulae may override system binaries - with other strange results. + Binaries provided by keg-only formulae may override system binaries + with other strange results. - You may wish to `brew unlink` these brews: + You may wish to `brew unlink` these brews: EOS end def check_for_other_frameworks # Other frameworks that are known to cause problems when present - %w[expat.framework libexpat.framework libcurl.framework]. - map { |frmwrk| "/Library/Frameworks/#{frmwrk}" }. - select { |frmwrk| File.exist? frmwrk }. - map do |frmwrk| - <<-EOS.undent - #{frmwrk} detected - This can be picked up by CMake's build system and likely cause the build to - fail. You may need to move this file out of the way to compile CMake. - EOS - end.join + frameworks_to_check = %w[ + expat.framework + libexpat.framework + libcurl.framework + ] + frameworks_found = frameworks_to_check. + map { |framework| "/Library/Frameworks/#{framework}" }. + select { |framework| File.exist? framework } + return if frameworks_found.empty? + + inject_file_list frameworks_found, <<-EOS.undent + Some frameworks can be picked up by CMake's build system and likely + cause the build to fail. To compile CMake, you may wish to move these + out of the way: + EOS end def check_tmpdir tmpdir = ENV["TMPDIR"] - "TMPDIR #{tmpdir.inspect} doesn't exist." unless tmpdir.nil? || File.directory?(tmpdir) + return if tmpdir.nil? || File.directory?(tmpdir) + + <<-EOS.undent + TMPDIR #{tmpdir.inspect} doesn't exist. + EOS end def check_missing_deps @@ -1121,84 +1186,91 @@ def check_missing_deps Homebrew::Diagnostic.missing_deps(Formula.installed).each_value do |deps| missing.merge(deps) end + return if missing.empty? - if missing.any? then <<-EOS.undent + <<-EOS.undent Some installed formula are missing dependencies. You should `brew install` the missing dependencies: - - brew install #{missing.sort_by(&:full_name) * " "} + brew install #{missing.sort_by(&:full_name) * " "} Run `brew missing` for more details. EOS - end end def check_git_status return unless Utils.git_available? HOMEBREW_REPOSITORY.cd do - unless `git status --untracked-files=all --porcelain -- Library/Homebrew/ 2>/dev/null`.chomp.empty? - <<-EOS.undent_________________________________________________________72 + return if `git status --untracked-files=all --porcelain -- Library/Homebrew/ 2>/dev/null`.chomp.empty? + end + + <<-EOS.undent You have uncommitted modifications to Homebrew If this is a surprise to you, then you should stash these modifications. Stashing returns Homebrew to a pristine state but can be undone should you later need to do so for some reason. - cd #{HOMEBREW_LIBRARY} && git stash && git clean -d -f - EOS - end - end + cd #{HOMEBREW_LIBRARY} && git stash && git clean -d -f + EOS end def check_for_enthought_python - if which "enpkg" then <<-EOS.undent - Enthought Python was found in your PATH. - This can cause build problems, as this software installs its own - copies of iconv and libxml2 into directories that are picked up by - other build systems. + return unless which "enpkg" + + <<-EOS.undent + Enthought Python was found in your PATH. + This can cause build problems, as this software installs its own + copies of iconv and libxml2 into directories that are picked up by + other build systems. EOS - end end def check_for_library_python - if File.exist?("/Library/Frameworks/Python.framework") then <<-EOS.undent - Python is installed at /Library/Frameworks/Python.framework + return unless File.exist?("/Library/Frameworks/Python.framework") - Homebrew only supports building against the System-provided Python or a - brewed Python. In particular, Pythons installed to /Library can interfere - with other software installs. + <<-EOS.undent + Python is installed at /Library/Frameworks/Python.framework + + Homebrew only supports building against the System-provided Python or a + brewed Python. In particular, Pythons installed to /Library can interfere + with other software installs. EOS - end end def check_for_old_homebrew_share_python_in_path - s = "" + message = "" ["", "3"].map do |suffix| if paths.include?((HOMEBREW_PREFIX/"share/python#{suffix}").to_s) - s += "#{HOMEBREW_PREFIX}/share/python#{suffix} is not needed in PATH.\n" + message += <<-EOS.undent + #{HOMEBREW_PREFIX}/share/python#{suffix} is not needed in PATH. + EOS end end - unless s.empty? - s += <<-EOS.undent - Formerly homebrew put Python scripts you installed via `pip` or `pip3` - (or `easy_install`) into that directory above but now it can be removed - from your PATH variable. - Python scripts will now install into #{HOMEBREW_PREFIX}/bin. - You can delete anything, except 'Extras', from the #{HOMEBREW_PREFIX}/share/python - (and #{HOMEBREW_PREFIX}/share/python3) dir and install affected Python packages - anew with `pip install --upgrade`. - EOS + unless message.empty? + message += <<-EOS.undent + + Formerly homebrew put Python scripts you installed via `pip` or `pip3` + (or `easy_install`) into that directory above but now it can be removed + from your PATH variable. + Python scripts will now install into #{HOMEBREW_PREFIX}/bin. + You can delete anything, except 'Extras', from the #{HOMEBREW_PREFIX}/share/python + (and #{HOMEBREW_PREFIX}/share/python3) dir and install affected Python packages + anew with `pip install --upgrade`. + EOS end + + message unless message.empty? end def check_for_bad_python_symlink return unless which "python" `python -V 2>&1` =~ /Python (\d+)\./ # This won't be the right warning if we matched nothing at all return if $1.nil? - unless $1 == "2" then <<-EOS.undent - python is symlinked to python#{$1} - This will confuse build scripts and in general lead to subtle breakage. + return if $1 == "2" + + <<-EOS.undent + python is symlinked to python#{$1} + This will confuse build scripts and in general lead to subtle breakage. EOS - end end def check_for_non_prefixed_coreutils @@ -1227,13 +1299,14 @@ def check_for_non_prefixed_findutils end def check_for_pydistutils_cfg_in_home - if File.exist? "#{ENV["HOME"]}/.pydistutils.cfg" then <<-EOS.undent - A .pydistutils.cfg file was found in $HOME, which may cause Python - builds to fail. See: - https://bugs.python.org/issue6138 - https://bugs.python.org/issue4655 + return unless File.exist? "#{ENV["HOME"]}/.pydistutils.cfg" + + <<-EOS.undent + A .pydistutils.cfg file was found in $HOME, which may cause Python + builds to fail. See: + https://bugs.python.org/issue6138 + https://bugs.python.org/issue4655 EOS - end end def check_for_outdated_homebrew @@ -1273,33 +1346,33 @@ def check_for_unlinked_but_not_keg_only true end end.map(&:basename) - return if unlinked.empty? + inject_file_list unlinked, <<-EOS.undent - You have unlinked kegs in your Cellar - Leaving kegs unlinked can lead to build-trouble and cause brews that depend on - those kegs to fail to run properly once built. Run `brew link` on these: + You have unlinked kegs in your Cellar + Leaving kegs unlinked can lead to build-trouble and cause brews that depend on + those kegs to fail to run properly once built. Run `brew link` on these: EOS end def check_xcode_license_approved # If the user installs Xcode-only, they have to approve the # license or no "xc*" tool will work. - if `/usr/bin/xcrun clang 2>&1` =~ /license/ && !$?.success? then <<-EOS.undent + return unless `/usr/bin/xcrun clang 2>&1` =~ /license/ && !$?.success? + + <<-EOS.undent You have not agreed to the Xcode license. Builds will fail! Agree to the license by opening Xcode.app or running: - sudo xcodebuild -license - EOS - end + sudo xcodebuild -license + EOS end def check_for_latest_xquartz return unless MacOS::XQuartz.version return if MacOS::XQuartz.provided_by_apple? installed_version = Version.new(MacOS::XQuartz.version) - latest_version = Version.new(MacOS::XQuartz.latest_version) - + latest_version = Version.new(MacOS::XQuartz.latest_version) return if installed_version >= latest_version <<-EOS.undent @@ -1310,28 +1383,28 @@ def check_for_latest_xquartz end def check_for_old_env_vars - if ENV["HOMEBREW_KEEP_INFO"] - <<-EOS.undent + return unless ENV["HOMEBREW_KEEP_INFO"] + + <<-EOS.undent `HOMEBREW_KEEP_INFO` is no longer used info files are no longer deleted by default; you may remove this environment variable. - EOS - end + EOS end def check_for_pth_support homebrew_site_packages = Language::Python.homebrew_site_packages return unless homebrew_site_packages.directory? return if Language::Python.reads_brewed_pth_files?("python") != false return unless Language::Python.in_sys_path?("python", homebrew_site_packages) + user_site_packages = Language::Python.user_site_packages "python" <<-EOS.undent Your default Python does not recognize the Homebrew site-packages directory as a special site-packages directory, which means that .pth files will not be followed. This means you will not be able to import some modules after installing them with Homebrew, like wxpython. To fix this for the current user, you can run: - mkdir -p #{user_site_packages} echo 'import site; site.addsitedir("#{homebrew_site_packages}")' >> #{user_site_packages}/homebrew.pth EOS @@ -1348,14 +1421,16 @@ def check_for_external_cmd_name_conflict end cmd_map.reject! { |_cmd_name, cmd_paths| cmd_paths.size == 1 } return if cmd_map.empty? - s = "You have external commands with conflicting names.\n" + + message = "You have external commands with conflicting names.\n" cmd_map.each do |cmd_name, cmd_paths| - s += inject_file_list cmd_paths, <<-EOS.undent + message += inject_file_list cmd_paths, <<-EOS.undent Found command `#{cmd_name}` in following places: EOS end - s + + message end def all
false
Other
Homebrew
brew
2ca97490afd02e104ee989baaab779199b36651b.json
brew.sh: fix HOMEBREW_OS_VERSION on Linux et al. On Linux (and other non-OS X platforms), `HOMEBREW_OS_VERSION` was *always* replaced with the product name, leading to less useful user agent. E.g., on a reasonably up-to-date Debian system: Linuxbrew/0.9.9 (Linux; unknown Linuxbrew) With this fix the user agent is instead (first if `lsb_release` is available and outputs something, second otherwise): Linuxbrew/0.9.9 (Linux; unknown Debian GNU/Linux 8.3 (jessie)) Linuxbrew/0.9.9 (Linux; unknown 3.16.0-4-amd64)
Library/brew.sh
@@ -93,7 +93,7 @@ then else HOMEBREW_PRODUCT="${HOMEBREW_SYSTEM}brew" [[ -n "$HOMEBREW_LINUX" ]] && HOMEBREW_OS_VERSION="$(lsb_release -sd 2>/dev/null)" - HOMEBREW_OS_VERSION="${HOMEBREW_PRODUCT:=$(uname -r)}" + : "${HOMEBREW_OS_VERSION:=$(uname -r)}" fi HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_VERSION)" HOMEBREW_CURL_VERSION="$("$HOMEBREW_CURL" --version 2>/dev/null | head -n1 | awk '{print $1"/"$2}')"
false
Other
Homebrew
brew
d83cd56603bcf208ee7a245b7cf44809cfbc7fdc.json
brew.sh: avoid unnecessary 'cat' Bash can read directly from a file in its command substitution.
Library/brew.sh
@@ -202,7 +202,7 @@ then HOMEBREW_ANALYTICS_USER_UUID_FILE="$HOME/.homebrew_analytics_user_uuid" if [[ -r "$HOMEBREW_ANALYTICS_USER_UUID_FILE" ]] then - HOMEBREW_ANALYTICS_USER_UUID="$(cat "$HOMEBREW_ANALYTICS_USER_UUID_FILE")" + HOMEBREW_ANALYTICS_USER_UUID="$(<"$HOMEBREW_ANALYTICS_USER_UUID_FILE")" else HOMEBREW_ANALYTICS_USER_UUID="$(uuidgen)" echo "$HOMEBREW_ANALYTICS_USER_UUID" > "$HOMEBREW_ANALYTICS_USER_UUID_FILE"
false
Other
Homebrew
brew
3a99d8093ca444c1039691387809f914f9a4a17c.json
brew.sh: streamline setting HOMEBREW_{OSX,LINUX} For uses like this one, `case` is much more compact and easier to read.
Library/brew.sh
@@ -58,13 +58,10 @@ then fi HOMEBREW_SYSTEM="$(uname -s)" -if [[ "$HOMEBREW_SYSTEM" = "Darwin" ]] -then - HOMEBREW_OSX="1" -elif [[ "$HOMEBREW_SYSTEM" = "Linux" ]] -then - HOMEBREW_LINUX="1" -fi +case "$HOMEBREW_SYSTEM" in + Darwin) HOMEBREW_OSX="1";; + Linux) HOMEBREW_LINUX="1";; +esac if [[ -z "$HOMEBREW_RUBY_PATH" ]] then
false
Other
Homebrew
brew
8ab2fb6868497023e369df939690af2a101ecafc.json
analytics: avoid unnecessary string interpolation
Library/Homebrew/utils/analytics.rb
@@ -18,7 +18,7 @@ def report_analytics(type, metadata={}) # https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters system ENV["HOMEBREW_CURL"], "https://www.google-analytics.com/collect", "-d", "v=1", "--silent", "--max-time", "3", "--output", "/dev/null", - "--user-agent", "#{HOMEBREW_USER_AGENT_CURL}", + "--user-agent", HOMEBREW_USER_AGENT_CURL, "-d", "tid=#{ENV["HOMEBREW_ANALYTICS_ID"]}", "-d", "cid=#{ENV["HOMEBREW_ANALYTICS_USER_UUID"]}", "-d", "aip=1",
false
Other
Homebrew
brew
1f8b6cb57677d96228627baf28ce18a394df4c1d.json
test-bot: add safety margin to output truncation size
Library/Homebrew/cmd/test-bot.rb
@@ -37,6 +37,8 @@ module Homebrew BYTES_IN_1_MEGABYTE = 1024*1024 + MAX_STEP_OUTPUT_SIZE = BYTES_IN_1_MEGABYTE - (200*1024) # margin of safety + HOMEBREW_TAP_REGEX = %r{^([\w-]+)/homebrew-([\w-]+)$} def ruby_has_encoding? @@ -997,14 +999,14 @@ def sanitize_output_for_xml(output) output = output.delete("\000\a\b\e\f\x2\x1f") end - # Truncate to 1MB - if output.bytesize > BYTES_IN_1_MEGABYTE + # Truncate to 1MB to avoid hitting CI limits + if output.bytesize > MAX_STEP_OUTPUT_SIZE if ruby_has_encoding? binary_output = output.force_encoding("BINARY") - output = binary_output.slice(-BYTES_IN_1_MEGABYTE, BYTES_IN_1_MEGABYTE) + output = binary_output.slice(-MAX_STEP_OUTPUT_SIZE, MAX_STEP_OUTPUT_SIZE) fix_encoding!(output) else - output = output.slice(-BYTES_IN_1_MEGABYTE, BYTES_IN_1_MEGABYTE) + output = output.slice(-MAX_STEP_OUTPUT_SIZE, MAX_STEP_OUTPUT_SIZE) end output = "truncated output to 1MB:\n" + output end
false
Other
Homebrew
brew
ea38a7039552b27334efad63897bbc3ad2b7263c.json
prune: handle broken app symlinks Remove broken symlinks from `/Applications` and `~/Applications` that were previously created by `brew linkapps`, but are no longer valid because formulae were uninstalled or the provided apps have changed.
Library/Homebrew/cmd/prune.rb
@@ -1,5 +1,6 @@ require "keg" require "cmd/tap" +require "cmd/unlinkapps" module Homebrew def prune @@ -45,5 +46,7 @@ def prune print "and #{d} directories " if d > 0 puts "from #{HOMEBREW_PREFIX}" end unless ARGV.dry_run? + + unlinkapps_prune(:dry_run => ARGV.dry_run?, :quiet => true) end end
true
Other
Homebrew
brew
ea38a7039552b27334efad63897bbc3ad2b7263c.json
prune: handle broken app symlinks Remove broken symlinks from `/Applications` and `~/Applications` that were previously created by `brew linkapps`, but are no longer valid because formulae were uninstalled or the provided apps have changed.
Library/Homebrew/cmd/unlinkapps.rb
@@ -9,22 +9,30 @@ def unlinkapps private + def unlinkapps_prune(opts = {}) + opts = opts.merge(:prune => true) + unlinkapps_from_dir(linkapps_target(:local => false), opts) + unlinkapps_from_dir(linkapps_target(:local => true), opts) + end + def unlinkapps_from_dir(target_dir, opts = {}) return unless target_dir.directory? dry_run = opts.fetch(:dry_run, false) + quiet = opts.fetch(:quiet, false) apps = Pathname.glob("#{target_dir}/*.app").select do |app| - unlinkapps_unlink?(app) + unlinkapps_unlink?(app, opts) end ObserverPathnameExtension.reset_counts! + app_kind = opts.fetch(:prune, false) ? " (broken link)" : "" apps.each do |app| app.extend(ObserverPathnameExtension) if dry_run - puts "Would unlink: #{app}" + puts "Would unlink#{app_kind}: #{app}" else - puts "Unlinking: #{app}" + puts "Unlinking#{app_kind}: #{app}" unless quiet app.unlink end end @@ -44,12 +52,14 @@ def unlinkapps_from_dir(target_dir, opts = {}) #{HOMEBREW_PREFIX}/opt/ ].freeze - def unlinkapps_unlink?(target_app) + def unlinkapps_unlink?(target_app, opts = {}) # Skip non-symlinks and symlinks that don't point into the Homebrew prefix. app = "#{target_app.readlink}" if target_app.symlink? return false unless app && app.start_with?(*UNLINKAPPS_PREFIXES) - if ARGV.named.empty? + if opts.fetch(:prune, false) + !File.exist?(app) # Remove only broken symlinks in prune mode. + elsif ARGV.named.empty? true else ARGV.kegs.any? { |keg| app.start_with?("#{keg}/", "#{keg.opt_record}/") }
true
Other
Homebrew
brew
ea38a7039552b27334efad63897bbc3ad2b7263c.json
prune: handle broken app symlinks Remove broken symlinks from `/Applications` and `~/Applications` that were previously created by `brew linkapps`, but are no longer valid because formulae were uninstalled or the provided apps have changed.
Library/Homebrew/manpages/brew.1.md
@@ -340,7 +340,9 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note * `prune` [`--dry-run`]: Remove dead symlinks from the Homebrew prefix. This is generally not - needed, but can be useful when doing DIY installations. + needed, but can be useful when doing DIY installations. Also remove broken + app symlinks from `/Applications` and `~/Applications` that were previously + created by `brew linkapps`. If `--dry-run` or `-n` is passed, show what would be removed, but do not actually remove anything.
true
Other
Homebrew
brew
ea38a7039552b27334efad63897bbc3ad2b7263c.json
prune: handle broken app symlinks Remove broken symlinks from `/Applications` and `~/Applications` that were previously created by `brew linkapps`, but are no longer valid because formulae were uninstalled or the provided apps have changed.
share/doc/homebrew/brew.1.html
@@ -267,7 +267,9 @@ <h2 id="COMMANDS">COMMANDS</h2> <dt><code>pin</code> <var>formulae</var></dt><dd><p>Pin the specified <var>formulae</var>, preventing them from being upgraded when issuing the <code>brew upgrade</code> command. See also <code>unpin</code>.</p></dd> <dt><code>prune</code> [<code>--dry-run</code>]</dt><dd><p>Remove dead symlinks from the Homebrew prefix. This is generally not -needed, but can be useful when doing DIY installations.</p> +needed, but can be useful when doing DIY installations. Also remove broken +app symlinks from <code>/Applications</code> and <code>~/Applications</code> that were previously +created by <code>brew linkapps</code>.</p> <p>If <code>--dry-run</code> or <code>-n</code> is passed, show what would be removed, but do not actually remove anything.</p></dd>
true
Other
Homebrew
brew
ea38a7039552b27334efad63897bbc3ad2b7263c.json
prune: handle broken app symlinks Remove broken symlinks from `/Applications` and `~/Applications` that were previously created by `brew linkapps`, but are no longer valid because formulae were uninstalled or the provided apps have changed.
share/man/man1/brew.1
@@ -365,7 +365,7 @@ Pin the specified \fIformulae\fR, preventing them from being upgraded when issui . .TP \fBprune\fR [\fB\-\-dry\-run\fR] -Remove dead symlinks from the Homebrew prefix\. This is generally not needed, but can be useful when doing DIY installations\. +Remove dead symlinks from the Homebrew prefix\. This is generally not needed, but can be useful when doing DIY installations\. Also remove broken app symlinks from \fB/Applications\fR and \fB~/Applications\fR that were previously created by \fBbrew linkapps\fR\. . .IP If \fB\-\-dry\-run\fR or \fB\-n\fR is passed, show what would be removed, but do not actually remove anything\.
true
Other
Homebrew
brew
37b817ed394986808d2fdb595c272ede7a67f20d.json
test-bot: fix access to relocated method Fix bug introduced in a2c23dfec569c6e73d90cb20c7d4c26cced258d5. Moving this method apparently made it inaccessible from `Homebrew::Step`.
Library/Homebrew/cmd/test-bot.rb
@@ -199,7 +199,7 @@ def run unless output.empty? - @output = fix_encoding!(output) + @output = Homebrew.fix_encoding!(output) puts @output if (failed? || @puts_output_on_success) && !verbose File.write(log_file_path, @output) if ARGV.include? "--keep-logs" end
false
Other
Homebrew
brew
a2c23dfec569c6e73d90cb20c7d4c26cced258d5.json
test-bot: fix undefined method error The method `fix_encoding!` is private to `Homebrew::Step` but is also required by the `Homebrew.sanitize_output_for_xml` method for truncating overly long logs. Move `fix_encoding!` into the `Homebrew` module to make it accessible from both this method and the `Homebrew::Step` class. This amends commit 343091c828d1e572829b86253d79b326c1986bcd.
Library/Homebrew/cmd/test-bot.rb
@@ -43,6 +43,24 @@ def ruby_has_encoding? String.method_defined?(:force_encoding) end + if ruby_has_encoding? + def fix_encoding!(str) + # Assume we are starting from a "mostly" UTF-8 string + str.force_encoding(Encoding::UTF_8) + return str if str.valid_encoding? + str.encode!(Encoding::UTF_16, :invalid => :replace) + str.encode!(Encoding::UTF_8) + end + elsif require "iconv" + def fix_encoding!(str) + Iconv.conv("UTF-8//IGNORE", "UTF-8", str) + end + else + def fix_encoding!(str) + str + end + end + def resolve_test_tap if tap = ARGV.value("tap") return Tap.fetch(tap) @@ -188,26 +206,6 @@ def run exit 1 if ARGV.include?("--fail-fast") && failed? end - - private - - if Homebrew.ruby_has_encoding? - def fix_encoding!(str) - # Assume we are starting from a "mostly" UTF-8 string - str.force_encoding(Encoding::UTF_8) - return str if str.valid_encoding? - str.encode!(Encoding::UTF_16, :invalid => :replace) - str.encode!(Encoding::UTF_8) - end - elsif require "iconv" - def fix_encoding!(str) - Iconv.conv("UTF-8//IGNORE", "UTF-8", str) - end - else - def fix_encoding!(str) - str - end - end end class Test
false
Other
Homebrew
brew
a9c0361a1d83374059fca73485643e89c2772331.json
audit: require plist_options when using plist Closes #19. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
Library/Homebrew/cmd/audit.rb
@@ -638,6 +638,10 @@ def audit_text problem "\"Formula.factory(name)\" is deprecated in favor of \"Formula[name]\"" end + if text =~ /def plist/ && text !~ /plist_options/ + problem "Please set plist_options when using a formula-defined plist." + end + if text =~ /system "npm", "install"/ && text !~ %r[opt_libexec\}/npm/bin] && formula.name !~ /^kibana(\d{2})?$/ need_npm = "\#{Formula[\"node\"].opt_libexec\}/npm/bin" problem <<-EOS.undent
false
Other
Homebrew
brew
776a73da7c4b92c73dea3e5065ea4b2d9873f029.json
test_cmd_audit: add plist test
Library/Homebrew/test/test_cmd_audit.rb
@@ -173,6 +173,24 @@ class Foo < Formula fa.problems end + def test_audit_file_strict_plist_placement + fa = formula_auditor "foo", <<-EOS.undent, :strict => true + class Foo < Formula + url "https://example.com/foo-1.0.tgz" + + test do + assert_match "Dogs are terrific", shell_output("./dogs") + end + + def plist + end + end + EOS + fa.audit_file + assert_equal ["`plist block` (line 8) should be put before `test block` (line 4)"], + fa.problems + end + def test_audit_file_strict_url_outside_of_stable_block fa = formula_auditor "foo", <<-EOS.undent, :strict => true class Foo < Formula
false
Other
Homebrew
brew
149334d88d18472dc218ab42791f90c19f53e838.json
audit: check plist placement
Library/Homebrew/cmd/audit.rb
@@ -187,6 +187,7 @@ def audit_file [/^ (go_)?resource/, "resource"], [/^ def install/, "install method"], [/^ def caveats/, "caveats method"], + [/^ (plist_options|def plist)/, "plist block"], [/^ test do/, "test block"], ]
false
Other
Homebrew
brew
f8cdab7d8a11d05fb7048a3674d832f427930b83.json
Make new keep? superenv logic opt-in Closes #50425. Signed-off-by: Misty De Meo <mistydemeo@github.com>
Library/ENV/4.3/cc
@@ -201,6 +201,10 @@ class Cmd end def keep?(path) + # The logic in this method will eventually become the default, + # but is currently opt-in. + return keep_orig?(path) unless ENV["HOMEBREW_EXPERIMENTAL_FILTER_FLAGS_ON_DEPS"] + # first two paths: reject references to Cellar or opt paths # for unspecified dependencies if path.start_with?(cellar) || path.start_with?(opt) @@ -213,6 +217,11 @@ class Cmd end end + # The original less-smart version of keep_orig; will eventually be removed + def keep_orig?(path) + path.start_with?(prefix, cellar, tmpdir) || !path.start_with?("/opt", "/sw", "/usr/X11") + end + def cflags args = []
true
Other
Homebrew
brew
f8cdab7d8a11d05fb7048a3674d832f427930b83.json
Make new keep? superenv logic opt-in Closes #50425. Signed-off-by: Misty De Meo <mistydemeo@github.com>
Library/Homebrew/cmd/test-bot.rb
@@ -856,6 +856,7 @@ def sanitize_ARGV_and_ENV ENV["HOMEBREW_SANDBOX"] = "1" ENV["HOMEBREW_NO_EMOJI"] = "1" ENV["HOMEBREW_FAIL_LOG_LINES"] = "150" + ENV["HOMEBREW_EXPERIMENTAL_FILTER_FLAGS_ON_DEPS"] = "1" if ENV["TRAVIS"] ARGV << "--verbose"
true
Other
Homebrew
brew
fa3c55aa650e815ce548e1276845171def2847f4.json
utils/analytics: fix usage of undefined variable.
Library/Homebrew/utils/analytics.rb
@@ -39,7 +39,7 @@ def report_analytics_event(category, action, label=analytics_anonymous_prefix_an def report_analytics_exception(exception, options={}) if exception.is_a? BuildError - report_analytics_event("BuildError", e.formula.full_name) + report_analytics_event("BuildError", exception.formula.full_name) end fatal = options.fetch(:fatal, true) ? "1" : "0"
false
Other
Homebrew
brew
c5cd206169c57609b1c6d2f4cff9e390b6350a27.json
brew.rb: report some exceptions.
Library/brew.rb
@@ -130,14 +130,17 @@ def require?(path) $stderr.puts # seemingly a newline is typical exit 130 rescue BuildError => e + report_analytics_exception(e) e.dump exit 1 rescue RuntimeError, SystemCallError => e + report_analytics_exception(e) raise if e.message.empty? onoe e $stderr.puts e.backtrace if ARGV.debug? exit 1 rescue Exception => e + report_analytics_exception(e) onoe e if internal_cmd $stderr.puts "#{Tty.white}Please report this bug:"
false
Other
Homebrew
brew
1238c65ba14831bc571cf01aead8fd10b916c837.json
utils: add analytics functions.
Library/Homebrew/utils.rb
@@ -5,6 +5,7 @@ require "utils/popen" require "utils/fork" require "utils/git" +require "utils/analytics" require "open-uri" class Tty
true
Other
Homebrew
brew
1238c65ba14831bc571cf01aead8fd10b916c837.json
utils: add analytics functions.
Library/Homebrew/utils/analytics.rb
@@ -0,0 +1,54 @@ + +def analytics_anonymous_prefix_and_os + @analytics_anonymous_prefix_and_os ||= begin + "#{OS_VERSION}, #{HOMEBREW_PREFIX.to_s.gsub(ENV["HOME"], "~")}" + end +end + +def report_analytics(type, metadata={}) + return unless ENV["HOMEBREW_ANALYTICS"] + + metadata_args = metadata.map do |key, value| + ["-d", "#{key}=#{value}"] if key && value + end.compact.flatten + + # Send analytics. Anonymise the IP address (aip=1) and don't send or store + # any personally identifiable information. + # https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide + # https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters + system "curl", "https://www.google-analytics.com/collect", "-d", "v=1", + "--silent", "--max-time", "3", "--output", "/dev/null", + "--user-agent", "#{HOMEBREW_USER_AGENT_CURL}", + "-d", "tid=#{ENV["HOMEBREW_ANALYTICS_ID"]}", + "-d", "cid=#{ENV["HOMEBREW_ANALYTICS_USER_UUID"]}", + "-d", "aip=1", + "-d", "an=Homebrew", + "-d", "av=#{HOMEBREW_VERSION}", + "-d", "t=#{type}", + *metadata_args +end + +def report_analytics_event(category, action, label=analytics_anonymous_prefix_and_os, value=nil) + report_analytics(:event, { + :ec => category, + :ea => action, + :el => label, + :ev => value, + }) +end + +def report_analytics_exception(exception, options={}) + if exception.is_a? BuildError + report_analytics_event("BuildError", e.formula.full_name) + end + + fatal = options.fetch(:fatal, true) ? "1" : "0" + report_analytics(:exception, { + :exd => exception.class.name, + :exf => fatal, + }) +end + +def report_analytics_screenview(screen_name) + report_analytics(:screenview, :cd => screen_name) +end
true
Other
Homebrew
brew
eec323aed81c14db6fd519aa734394ffe1071db8.json
travis: fix rsync problem
.travis.yml
@@ -18,7 +18,7 @@ matrix: before_install: - export TRAVIS_COMMIT=$(git rev-parse --verify -q HEAD) - cd /usr/local - - sudo rm -rf /usr/local/.git/refs /usr/local/.git/packed-refs + - sudo rm -rf /usr/local/.git/refs /usr/local/.git/packed-refs /usr/local/Library - sudo rsync -az "$TRAVIS_BUILD_DIR/" /usr/local/ - sudo chown -R $USER /usr/local - export TRAVIS_BUILD_DIR="/usr/local"
false
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
.github/CONTRIBUTING.md
@@ -8,30 +8,4 @@ First time contributing to Homebrew? Read our [Code of Conduct](https://github.c * read [the Troubleshooting Checklist](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting) * open an issue on the formula's repository -### Submit a `1.2.3` version upgrade for the `foo` formula - -* check if the same upgrade has been already submitted by [searching the open pull requests for `foo`](https://github.com/Homebrew/homebrew/pulls?utf8=✓&q=is%3Apr+is%3Aopen+foo). -* `brew edit foo` -* edit [`url`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#url-class_method) and [`sha256`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#sha256%3D-class_method)/[`tag`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#url-class_method), leave the [`bottle`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#bottle-class_method) as-is -* `brew install foo` -* run `brew audit foo` and fix any issues -* `git commit` with commit subject `foo 1.2.3` -* [open a pull request](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) and fix any failing tests - -### Add a new formula for `foo` version `2.3.4` from `$URL` - -* read [the Formula Cookbook](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md#formula-cookbook) or: `brew create $URL` and make edits -* `brew install foo` -* `brew audit --online --strict foo` -* `git commit` with message formatted `foo 2.3.4 (new formula)` -* [open a pull request](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) and fix any failing tests - -### Contribute a fix to the `foo` formula - -* `brew edit foo` and make edits -* leave the [`bottle`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#bottle-class_method) as-is -* `brew install foo`, `brew test foo`, and `brew audit foo` -* `git commit` with message formatted `foo: fix <insert details>` -* [open a pull request](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) and fix any failing tests - Thanks!
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
.github/ISSUE_TEMPLATE.md
@@ -8,13 +8,10 @@ _You can erase any parts of this template not applicable to your Issue._ ### Bug reports: -Please replace this line with a brief summary of your issue **AND** if reporting a build issue include the link from: +Please replace this line with a brief summary of your issue. -`brew gist-logs <formula>` -(where `<formula>` is the name of the formula that failed to build). +### Feature Requests: -### Feature/Formula Requests: - -**Please note by far the quickest way to get a new feature or formula into Homebrew is to file a [Pull Request](https://github.com/Homebrew/homebrew/blob/master/.github/CONTRIBUTING.md).** +**Please note by far the quickest way to get a new feature into Homebrew is to file a [Pull Request](https://github.com/Homebrew/brew/blob/master/.github/CONTRIBUTING.md).** We will consider your request but it may be closed if it's something we're not actively planning to work on.
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
.github/PULL_REQUEST_TEMPLATE.md
@@ -1,18 +1,5 @@ -### All Submissions: - -- [ ] Have you followed the guidelines in our [Contributing](https://github.com/Homebrew/homebrew/blob/master/.github/CONTRIBUTING.md) document? -- [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/Homebrew/homebrew/pulls) for the same update/change? - -_You can erase any parts of this template not applicable to your Pull Request._ - -### New Formulae Submissions: - -- [ ] Does your submission pass -`brew audit --strict --online <formula>` (where `<formula>` is the name of the formula you're submitting)? -- [ ] Have you built your formula locally prior to submission with `brew install <formula>`? - -### Changes to Homebrew's Core: - +- [ ] Have you followed the guidelines in our [Contributing](https://github.com/Homebrew/brew/blob/master/.github/CONTRIBUTING.md) document? +- [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/Homebrew/brew/pulls) for the same change? - [ ] Have you added an explanation of what your changes do and why you'd like us to include them? -- [ ] Have you written new tests for your core changes, as applicable? [Here's an example](https://github.com/Homebrew/homebrew/pull/49031) if you'd like one. +- [ ] Have you written new tests for your changes? [Here's an example](https://github.com/Homebrew/homebrew/pull/49031). - [ ] Have you successfully ran `brew tests` with your changes locally?
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
Library/Homebrew/README.md
@@ -3,6 +3,6 @@ This is the (partially) documented public API for Homebrew. The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private. -You may also find the [Formula Cookbook](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md) and [Ruby Style Guide](https://github.com/styleguide/ruby) helpful in creating formulae. +You may also find the [Formula Cookbook](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md) and [Ruby Style Guide](https://github.com/styleguide/ruby) helpful in creating formulae. Good luck!
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
Library/Homebrew/cmd/create.rb
@@ -129,8 +129,8 @@ def generate! end def template; <<-EOS.undent - # Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md - # http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula + # Documentation: https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md + # http://www.rubydoc.info/github/Homebrew/brew/master/Formula # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! class #{Formulary.class_s(name)} < Formula
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
Library/Homebrew/cmd/help.rb
@@ -17,7 +17,7 @@ Brewing: brew create [URL [--no-fetch]] brew edit [FORMULA...] - https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md + https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md Further help: man brew
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
Library/Homebrew/cmd/tap-readme.rb
@@ -21,7 +21,7 @@ def tap_readme ``` ## Documentation - `brew help`, `man brew` or check [Homebrew's documentation](https://github.com/Homebrew/homebrew/tree/master/share/doc/homebrew#readme). + `brew help`, `man brew` or check [Homebrew's documentation](https://github.com/Homebrew/brew/tree/master/share/doc/homebrew#readme). EOS puts template if ARGV.verbose?
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
Library/Homebrew/formula.rb
@@ -1697,7 +1697,7 @@ def mirror(val) # and you haven't passed or previously used any options on this formula. # # If you maintain your own repository, you can add your own bottle links. - # https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Bottles.md + # https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Bottles.md # You can ignore this block entirely if submitting to Homebrew/Homebrew, It'll be # handled for you by the Brew Test Bot. #
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
Library/Homebrew/manpages/brew.1.md
@@ -88,7 +88,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note and version, but if it fails, you'll have to make your own template. The `wget` formula serves as a simple example. For the complete API have a look at - <http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula> + <http://www.rubydoc.info/github/Homebrew/brew/master/Formula> If `--autotools` is passed, create a basic template for an Autotools-style build. If `--cmake` is passed, create a basic template for a CMake-style build. @@ -194,7 +194,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note information on all installed formulae. See the docs for examples of using the JSON: - <https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Querying-Brew.md> + <https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Querying-Brew.md> * `install` [`--debug`] [`--env=`<std>|<super>] [`--ignore-dependencies`] [`--only-dependencies`] [`--cc=`<compiler>] [`--build-from-source`|`--force-bottle`] [`--devel`|`--HEAD`] <formula>: Install <formula>. @@ -415,7 +415,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note Pass `--installed` to get information on installed taps. See the docs for examples of using the JSON: - <https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Querying-Brew.md> + <https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Querying-Brew.md> * `tap-pin` <tap>: Pin <tap>, prioritizing its formulae over core when formula names are supplied @@ -543,7 +543,7 @@ scripts that reside somewhere in the `PATH`, named `brew-`<cmdname> or to create your own commands without modifying Homebrew's internals. Instructions for creating your own commands can be found in the docs: -<https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/External-Commands.md> +<https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/External-Commands.md> ## SPECIFYING FORMULAE @@ -714,7 +714,7 @@ If your proxy requires authentication: ## SEE ALSO -Homebrew Documentation: <https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/> +Homebrew Documentation: <https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/> `git`(1), `git-log`(1) @@ -728,6 +728,6 @@ Former maintainers with significant contributions include Jack Nagel, Adam Vande See our issues on GitHub: - * Homebrew <https://github.com/Homebrew/homebrew/issues> + * Homebrew/brew <https://github.com/Homebrew/brew/issues> * Homebrew/homebrew-core <https://github.com/Homebrew/homebrew-core/issues>
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
Library/Homebrew/os/mac/xcode.rb
@@ -105,7 +105,7 @@ def uncached_version when 2327..2333 then "3.2.5" when 2335 # this build number applies to 3.2.6, 4.0 and 4.1 - # https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Xcode.md + # https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Xcode.md "4.0" else case (MacOS.clang_version.to_f * 10).to_i
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
Library/Homebrew/test/test_cmd_info.rb
@@ -4,10 +4,10 @@ class InfoCommandTests < Homebrew::TestCase def test_github_remote_path - remote = "https://github.com/Homebrew/homebrew" - assert_equal "https://github.com/Homebrew/homebrew/blob/master/Formula/git.rb", + remote = "https://github.com/Homebrew/homebrew-core" + assert_equal "https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb", Homebrew.github_remote_path(remote, "Formula/git.rb") - assert_equal "https://github.com/Homebrew/homebrew/blob/master/Formula/git.rb", + assert_equal "https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb", Homebrew.github_remote_path("#{remote}.git", "Formula/git.rb") assert_equal "https://github.com/user/repo/blob/master/foo.rb",
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
README.md
@@ -7,12 +7,12 @@ Features, usage and installation instructions are [summarised on the homepage](h 3. Or use `brew search --desc` to browse packages from the command line. ## More Documentation -`brew help`, `man brew` or check [our documentation](https://github.com/Homebrew/homebrew/tree/master/share/doc/homebrew#readme). +`brew help`, `man brew` or check [our documentation](https://github.com/Homebrew/brew/tree/master/share/doc/homebrew#readme). ## Troubleshooting First, please run `brew update` and `brew doctor`. -Second, read the [Troubleshooting Checklist](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting). +Second, read the [Troubleshooting Checklist](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting). **If you don't read these it will take us far longer to help you with your problem.** @@ -30,7 +30,7 @@ Homebrew's current maintainers are [Misty De Meo](https://github.com/mistydemeo) Former maintainers with significant contributions include [Jack Nagel](https://github.com/jacknagel), [Adam Vandenberg](https://github.com/adamv) and Homebrew's creator: [Max Howell](https://github.com/mxcl). ## License -Code is under the [BSD 2 Clause (NetBSD) license](https://github.com/Homebrew/homebrew/tree/master/LICENSE.txt). +Code is under the [BSD 2 Clause (NetBSD) license](https://github.com/Homebrew/brew/tree/master/LICENSE.txt). Documentation is under the [Creative Commons Attribution license](https://creativecommons.org/licenses/by/4.0/). ## Donations @@ -41,14 +41,14 @@ Homebrew is a member of the [Software Freedom Conservancy](http://sfconservancy. - [Donate with PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=V6ZE57MJRYC8L) - Donate by USA $ check from a USA bank: - Make check payable to "Software Freedom Conservancy, Inc." and place "Directed donation: Homebrew" in the memo field. Checks should then be mailed to: - - Software Freedom Conservancy, Inc. - 137 Montague ST STE 380 - BROOKLYN, NY 11201 USA + - Software Freedom Conservancy, Inc. + 137 Montague ST STE 380 + BROOKLYN, NY 11201 USA - Donate by wire transfer: contact accounting@sfconservancy.org for wire transfer details. - Donate with Flattr or PayPal Giving Fund: coming soon. ## Sponsors -Our CI infrastructure was paid for by [our Kickstarter supporters](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Kickstarter-Supporters.md). +Our CI infrastructure was paid for by [our Kickstarter supporters](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Kickstarter-Supporters.md). Our CI infrastructure is hosted by [The Positive Internet Company](http://www.positive-internet.com).
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md
@@ -7,9 +7,9 @@ There are two types of Jenkins jobs you will interact with: This job automatically builds any pull requests submitted to Homebrew/homebrew-core. On success or failure it updates the pull request status (see more details on the [main Brew Test Bot wiki page](Brew-Test-Bot.md)). On a successful build it automatically uploads bottles. ## [Homebrew Testing](http://bot.brew.sh/job/Homebrew%20Testing/) -This job is manually triggered to run [`brew test-bot`](https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/cmd/test-bot.rb) with user-specified parameters. On a successful build it automatically uploads bottles. +This job is manually triggered to run [`brew test-bot`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/test-bot.rb) with user-specified parameters. On a successful build it automatically uploads bottles. -You can manually start this job with parameters to run [`brew test-bot`](https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/cmd/test-bot.rb) with the same parameters. It's often useful to pass a pull request URL, a commit URL, a commit SHA-1 and/or formula names to have `brew-test-bot` test them, report the results and produce bottles. +You can manually start this job with parameters to run [`brew test-bot`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/test-bot.rb) with the same parameters. It's often useful to pass a pull request URL, a commit URL, a commit SHA-1 and/or formula names to have `brew-test-bot` test them, report the results and produce bottles. ## Bottling To pull and bottle a pull request with `brew pull`:
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/Brew-Test-Bot.md
@@ -4,7 +4,7 @@ by [our Kickstarter in 2013](https://www.kickstarter.com/projects/homebrew/brew- It comprises of four Mac Minis running in a data centre in England which host [a Jenkins instance at http://bot.brew.sh](http://bot.brew.sh) and run the -[`brew-test-bot.rb`](https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/cmd/test-bot.rb) +[`brew-test-bot.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/test-bot.rb) Ruby script to perform automated testing of commits to the master branch, pull requests and custom builds requested by maintainers.
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/Common-Issues.md
@@ -76,7 +76,7 @@ When running `brew upgrade`, you see something like this: $ brew upgrade Error: undefined method `include?' for nil:NilClass Please report this bug: - https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md + https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Troubleshooting.md /usr/local/Library/Homebrew/formula.rb:393:in `canonical_name' /usr/local/Library/Homebrew/formula.rb:425:in `factory' /usr/local/Library/Contributions/examples/brew-upgrade.rb:7
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/External-Commands.md
@@ -95,4 +95,4 @@ These commands have been contributed by Homebrew users but are not included in t > ``` ## SEE ALSO -Homebrew Docs: <https://github.com/Homebrew/homebrew/tree/master/share/doc/homebrew> +Homebrew Docs: <https://github.com/Homebrew/brew/tree/master/share/doc/homebrew>
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/Formula-Cookbook.md
@@ -1,5 +1,5 @@ # Formula Cookbook -A formula is a package definition written in Ruby. It can be created with `brew create $URL` and installed with `brew install $FORMULA` and debugged with `brew install --debug --verbose $FORMULA`. Formulae use the [Formula API](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula) which provides various Homebrew-specific helpers. +A formula is a package definition written in Ruby. It can be created with `brew create $URL` and installed with `brew install $FORMULA` and debugged with `brew install --debug --verbose $FORMULA`. Formulae use the [Formula API](http://www.rubydoc.info/github/Homebrew/brew/master/Formula) which provides various Homebrew-specific helpers. ## Homebrew Terminology @@ -34,7 +34,7 @@ Before submitting a new formula make sure your package: * has a stable, tagged version (i.e. not just a GitHub repository with no versions). See [Interesting-Taps-&-Branches](Interesting-Taps-&-Branches.md) for where pre-release versions belong. * passes all `brew audit --strict --online $FORMULA` tests. -Before submitting a new formula make sure you read over our [contribution guidelines](https://github.com/Homebrew/homebrew/blob/master/.github/CONTRIBUTING.md). +Before submitting a new formula make sure you read over our [contribution guidelines](https://github.com/Homebrew/brew/blob/master/.github/CONTRIBUTING.md). ## Grab the URL @@ -63,18 +63,18 @@ class Foo < Formula end ``` -If `brew` said `Warning: Version cannot be determined from URL` when doing the `create` step, you’ll need to explicitly add the correct [`version`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#version-class_method) to the formula and then save the formula. +If `brew` said `Warning: Version cannot be determined from URL` when doing the `create` step, you’ll need to explicitly add the correct [`version`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version-class_method) to the formula and then save the formula. Homebrew will try to guess the formula’s name from its URL. If it fails to do so you can override this with `brew create <url> --set-name <name>`. -## Fill in the [`homepage`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#homepage%3D-class_method) +## Fill in the [`homepage`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#homepage%3D-class_method) -**We don’t accept formulae without a [`homepage`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#homepage%3D-class_method)!** +**We don’t accept formulae without a [`homepage`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#homepage%3D-class_method)!** -A SSL/TLS (https) [`homepage`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#homepage%3D-class_method) is preferred, if one is available. +A SSL/TLS (https) [`homepage`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#homepage%3D-class_method) is preferred, if one is available. -Try to summarize from the [`homepage`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#homepage%3D-class_method) what the formula does in the [`desc`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#desc%3D-class_method)ription. Note that the [`desc`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#desc%3D-class_method)ription is automatically prepended with the formula name. +Try to summarize from the [`homepage`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#homepage%3D-class_method) what the formula does in the [`desc`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#desc%3D-class_method)ription. Note that the [`desc`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#desc%3D-class_method)ription is automatically prepended with the formula name. ## Check the build system @@ -105,7 +105,7 @@ We generally try to not duplicate system libraries and complicated tools in core One very special exception is OpenSSL. Anything that uses OpenSSL *should* be built using Homebrew’s shipped OpenSSL and our test bot's post-install `audit` will warn if it detects you haven't done this. Homebrew’s OpenSSL is -[`keg_only`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#keg_only-class_method) +[`keg_only`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#keg_only-class_method) to avoid conflicting with the system so sometimes formulae need to have environment variables set or special configuration flags passed to locate our OpenSSL. You can see this mechanism in the @@ -116,7 +116,7 @@ prefix. Homebrew maintains a special [tap that provides other useful system duplicates](https://github.com/Homebrew/homebrew-dupes). -*Important:* `$(brew --prefix)/bin` is NOT on the `$PATH` during formula installation. If you have dependencies at build time, you must specify them and brew will add them to the `$PATH` or create a [`Requirement`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Requirement). +*Important:* `$(brew --prefix)/bin` is NOT on the `$PATH` during formula installation. If you have dependencies at build time, you must specify them and brew will add them to the `$PATH` or create a [`Requirement`](http://www.rubydoc.info/github/Homebrew/brew/master/Requirement). ## Specifying other formulae as dependencies @@ -132,7 +132,7 @@ end A String (e.g. `"jpeg"`) specifies a formula dependency. -A Symbol (e.g. `:x11`) specifies a [`Requirement`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Requirement) which can be fulfilled by one or more formulae, casks or other system-wide installed software (e.g. X11). +A Symbol (e.g. `:x11`) specifies a [`Requirement`](http://www.rubydoc.info/github/Homebrew/brew/master/Requirement) which can be fulfilled by one or more formulae, casks or other system-wide installed software (e.g. X11). A Hash (e.g. `=>`) specifies a formula dependency with some additional information. Given a single string key, the value can take several forms: @@ -166,16 +166,16 @@ A Hash (e.g. `=>`) specifies a formula dependency with some additional informati ## Specifying conflicts with other formulae -Sometimes there’s hard conflict between formulae, and it can’t be avoided or circumvented with [`keg_only`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#keg_only-class_method). +Sometimes there’s hard conflict between formulae, and it can’t be avoided or circumvented with [`keg_only`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#keg_only-class_method). `mbedtls` is a good [example](https://github.com/Homebrew/homebrew-core/blob/master/Formula/mbedtls.rb) formula for minor conflict. `mbedtls` ships and compiles a "Hello World" executable. This is obviously non-essential to `mbedtls`’s functionality, and conflict with the popular GNU `hello` formula would be overkill, so we just remove it. [pdftohtml](https://github.com/Homebrew/homebrew-core/blob/master/Formula/pdftohtml.rb) provides an example of a serious -conflict, where both formula ship an identically-named binary that is essential to functionality, so a [`conflicts_with`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#conflicts_with-class_method) is preferable. +conflict, where both formula ship an identically-named binary that is essential to functionality, so a [`conflicts_with`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#conflicts_with-class_method) is preferable. -As a general rule, [`conflicts_with`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#conflicts_with-class_method) should be a last-resort option. It’s a fairly blunt instrument. +As a general rule, [`conflicts_with`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#conflicts_with-class_method) should be a last-resort option. It’s a fairly blunt instrument. The syntax for conflict that can’t be worked around is: @@ -187,11 +187,11 @@ conflicts_with "blueduck", :because => "yellowduck also ships a duck binary" In Homebrew we sometimes accept formulae updates that don’t include a version bump. These include resource updates, new patches or fixing a security issue with a formula. -Occasionally, these updates require a forced-recompile of the formula itself or its dependents to either ensure formulae continue to function as expected or to close a security issue. This forced-recompile is known as a [`revision`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#revision%3D-class_method) and inserted underneath the `homepage`/`url`/`sha` block. +Occasionally, these updates require a forced-recompile of the formula itself or its dependents to either ensure formulae continue to function as expected or to close a security issue. This forced-recompile is known as a [`revision`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#revision%3D-class_method) and inserted underneath the `homepage`/`url`/`sha` block. -Where a dependent of a formula fails against a new version of that dependency it must receive a [`revision`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#revision%3D-class_method). An example of such failure can be seen [here](https://github.com/Homebrew/homebrew/issues/31195) and the fix [here](https://github.com/Homebrew/homebrew/pull/31207). +Where a dependent of a formula fails against a new version of that dependency it must receive a [`revision`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#revision%3D-class_method). An example of such failure can be seen [here](https://github.com/Homebrew/homebrew/issues/31195) and the fix [here](https://github.com/Homebrew/homebrew/pull/31207). -[`revision`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#revision%3D-class_method)s are also used for formulae that move from the system OpenSSL to the Homebrew-shipped OpenSSL without any other changes to that formula. This ensures users aren’t left exposed to the potential security issues of the outdated OpenSSL. An example of this can be seen in [this commit](https://github.com/Homebrew/homebrew/commit/6b9d60d474d72b1848304297d91adc6120ea6f96). +[`revision`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#revision%3D-class_method)s are also used for formulae that move from the system OpenSSL to the Homebrew-shipped OpenSSL without any other changes to that formula. This ensures users aren’t left exposed to the potential security issues of the outdated OpenSSL. An example of this can be seen in [this commit](https://github.com/Homebrew/homebrew/commit/6b9d60d474d72b1848304297d91adc6120ea6f96). ## Double-check for dependencies @@ -216,7 +216,7 @@ $ otool -L /usr/local/bin/ldapvi Homebrew doesn’t package already packaged language-specific libraries. These should be installed directly from `gem`/`cpan`/`pip` etc. -If you're installing an application then please use [`resource`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#resource-class_method)s for all the language-specific dependencies: +If you're installing an application then please use [`resource`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#resource-class_method)s for all the language-specific dependencies: ```ruby class Foo < Formula @@ -247,15 +247,15 @@ Check the top of the e.g. `./configure` output. Some configure scripts do not re ## Add a test to the formula -Please add a [`test do`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#test-class_method) block to the formula. This will be run by `brew test foo` and the [Brew Test Bot](Brew-Test-Bot.md). +Please add a [`test do`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#test-class_method) block to the formula. This will be run by `brew test foo` and the [Brew Test Bot](Brew-Test-Bot.md). The -[`test do`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#test-class_method) +[`test do`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#test-class_method) block automatically creates and changes to a temporary directory which is deleted after run. You can access this -[`Pathname`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Pathname) +[`Pathname`](http://www.rubydoc.info/github/Homebrew/brew/master/Pathname) with the -[`testpath`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#testpath-instance_method) +[`testpath`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#testpath-instance_method) function. The environment variable `HOME` is set to `testpath` within the `test do` block. @@ -279,7 +279,7 @@ If you’re not sure about the name check the homepage, and check the Wikipedia Where Homebrew already has a formula called `foo` we typically do not accept requests to replace that formula with something else also named `foo`. This is to avoid both confusing and surprising users’ expectation. -When two formulae share an upstream name, e.g. [`AESCrypt`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/aescrypt.rb) and [`AESCrypt`](https://github.com/Homebrew/homebrew/blob-core/master/Formula/aescrypt-packetizer.rb) the newer formula must typically adapt the name to avoid conflict with the current formula. +When two formulae share an upstream name, e.g. [`AESCrypt`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/aescrypt.rb) and [`AESCrypt`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/aescrypt-packetizer.rb) the newer formula must typically adapt the name to avoid conflict with the current formula. If you’re *still* not sure, just commit. We’ll apply some arbitrary rule and make a decision :wink:. @@ -299,7 +299,7 @@ You can run `brew audit --strict --online` to test formulae for adherence to Hom New formulae being submitted to Homebrew should run `brew audit --strict --online foo`. This command is performed by the Brew Test Bot on new submissions as part of the automated build and test process, and highlights more potential issues than the standard audit. Use `brew info` and check if the version guessed by Homebrew from the URL is -correct. Add an explicit [`version`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#version-class_method) if not. +correct. Add an explicit [`version`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version-class_method) if not. ## Commit @@ -340,7 +340,7 @@ If you have already forked Homebrew on GitHub, then you can manually push (just git push https://github.com/myname/homebrew/ <what-you-called-your-branch> ``` -Now, please [open a pull request](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) for your changes. +Now, please [open a pull request](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md#how-to-open-a-homebrew-pull-request-and-get-it-merged) for your changes. * One formula per commit; one commit per formula * Keep merge commits out of the pull request @@ -367,7 +367,7 @@ system "make", "install" You’ll see stuff like that in other formulae. This moves the file `foo` into the Formula’s `bin` directory (`/usr/local/Cellar/pkg/0.1/bin`) and makes it executable (`chmod 0555 foo`). -## [`inreplace`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Utils/Inreplace) +## [`inreplace`](http://www.rubydoc.info/github/Homebrew/brew/master/Utils/Inreplace) A convenience function that can edit files in-place. For example: @@ -404,13 +404,13 @@ Note that values *can* contain unescaped spaces if you use the multiple-argument ## Patches -While [`patch`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#patch-class_method)es should generally be avoided, sometimes they are necessary. +While [`patch`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#patch-class_method)es should generally be avoided, sometimes they are necessary. -When [`patch`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#patch-class_method)ing (i.e. fixing header file inclusion, fixing compiler warnings, etc.) the first thing to do is check whether or not the upstream project is aware of the issue. If not, file a bug report and/or submit your patch for inclusion. We may sometimes still accept your patch before it was submitted upstream but by getting the ball rolling on fixing the upstream issue you reduce the length of time we have to carry the patch around. +When [`patch`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#patch-class_method)ing (i.e. fixing header file inclusion, fixing compiler warnings, etc.) the first thing to do is check whether or not the upstream project is aware of the issue. If not, file a bug report and/or submit your patch for inclusion. We may sometimes still accept your patch before it was submitted upstream but by getting the ball rolling on fixing the upstream issue you reduce the length of time we have to carry the patch around. -*Always justify a [`patch`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#patch-class_method) with a code comment!* Otherwise, nobody will know when it is safe to remove the patch, or safe to leave it in when updating the formula. The comment should include a link to the relevant upstream issue(s). +*Always justify a [`patch`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#patch-class_method) with a code comment!* Otherwise, nobody will know when it is safe to remove the patch, or safe to leave it in when updating the formula. The comment should include a link to the relevant upstream issue(s). -External [`patch`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#patch-class_method)es can be declared using resource-style blocks: +External [`patch`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#patch-class_method)es can be declared using resource-style blocks: ```ruby patch do @@ -428,7 +428,7 @@ patch :p0 do end ``` -[`patch`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#patch-class_method)es can be declared in [`stable`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#stable-class_method), [`devel`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#devel-class_method), and [`head`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#head-class_method) blocks. NOTE: always use a block instead of a conditional, i.e. `stable do ... end` instead of `if build.stable? then ... end`. +[`patch`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#patch-class_method)es can be declared in [`stable`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#stable-class_method), [`devel`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#devel-class_method), and [`head`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#head-class_method) blocks. NOTE: always use a block instead of a conditional, i.e. `stable do ... end` instead of `if build.stable? then ... end`. ```rb stable do @@ -485,11 +485,11 @@ If anything isn’t clear, you can usually figure it out by `grep`ping the `$(br ## Unstable versions (`devel`, `head`) -Formulae can specify alternate downloads for the upstream project’s [`devel`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#devel-class_method) release (unstable but not `master`/`trunk`) or [`head`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#head-class_method) (`master`/`trunk`). +Formulae can specify alternate downloads for the upstream project’s [`devel`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#devel-class_method) release (unstable but not `master`/`trunk`) or [`head`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#head-class_method) (`master`/`trunk`). ### `devel` -The [`devel`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#devel-class_method) spec (activated by passing `--devel`) is used for a project’s unstable releases. It is specified in a block: +The [`devel`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#devel-class_method) spec (activated by passing `--devel`) is used for a project’s unstable releases. It is specified in a block: ```ruby devel do @@ -502,17 +502,17 @@ You can test if the `devel` spec is in use with `build.devel?`. ### `head` -[`head`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#head-class_method) URLs (activated by passing `--HEAD`) build the development cutting edge. Specifying it is easy: +[`head`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#head-class_method) URLs (activated by passing `--HEAD`) build the development cutting edge. Specifying it is easy: ```ruby class Foo < Formula head "https://github.com/mxcl/lastfm-cocoa.git" end ``` -Homebrew understands `git`, `svn`, and `hg` URLs, and has a way to specify `cvs` repositories as a URL as well. You can test whether the [`head`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#head-class_method) is being built with `build.head?`. +Homebrew understands `git`, `svn`, and `hg` URLs, and has a way to specify `cvs` repositories as a URL as well. You can test whether the [`head`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#head-class_method) is being built with `build.head?`. -To use a specific commit, tag, or branch from a repository, specify [`head`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#head-class_method) with the `:tag` and `:revision`, `:revision`, or `:branch` option, like so: +To use a specific commit, tag, or branch from a repository, specify [`head`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#head-class_method) with the `:tag` and `:revision`, `:revision`, or `:branch` option, like so: ```ruby class Foo < Formula @@ -525,7 +525,7 @@ end ## Compiler selection -Sometimes a package fails to build when using a certain compiler. Since recent Xcodes no longer include a GCC compiler we cannot simply force the use of GCC. Instead, the correct way to declare this is the [`fails_with` DSL method](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#fails_with-class_method). A properly constructed [`fails_with`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#fails_with-class_method) block documents the latest compiler build version known to cause compilation to fail, and the cause of the failure. For example: +Sometimes a package fails to build when using a certain compiler. Since recent Xcodes no longer include a GCC compiler we cannot simply force the use of GCC. Instead, the correct way to declare this is the [`fails_with` DSL method](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#fails_with-class_method). A properly constructed [`fails_with`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#fails_with-class_method) block documents the latest compiler build version known to cause compilation to fail, and the cause of the failure. For example: ```ruby fails_with :llvm do @@ -541,7 +541,7 @@ end `build` takes a Fixnum (an integer; you can find this number in your `brew --config` output). `cause` takes a String, and the use of heredocs is encouraged to improve readability and allow for more comprehensive documentation. -[`fails_with`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#fails_with-class_method) declarations can be used with any of `:gcc`, `:llvm`, and `:clang`. Homebrew will use this information to select a working compiler (if one is available). +[`fails_with`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#fails_with-class_method) declarations can be used with any of `:gcc`, `:llvm`, and `:clang`. Homebrew will use this information to select a working compiler (if one is available). ## Specifying the Download Strategy explicitly @@ -568,7 +568,7 @@ Download strategies offered by Homebrew are: | `:post` | `CurlPostDownloadStrategy` | | `:svn` | `SubversionDownloadStrategy` | -If you need more control over the way files are downloaded and staged, you can create a custom download strategy and specify it using the [`url`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#url-class_method) method's `:using` option: +If you need more control over the way files are downloaded and staged, you can create a custom download strategy and specify it using the [`url`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#url-class_method) method's `:using` option: ```ruby @@ -714,11 +714,11 @@ to create the directory structure to the manual page location. To install man pages into specific locations, use `man1.install "foo.1", "bar.1"`, `man2.install "foo.2"`, etc. -Note that in the context of Homebrew, [`libexec`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#libexec-instance_method) is reserved for private use by the formula and therefore is not symlinked into `HOMEBREW_PREFIX`. +Note that in the context of Homebrew, [`libexec`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#libexec-instance_method) is reserved for private use by the formula and therefore is not symlinked into `HOMEBREW_PREFIX`. ## Adding optional steps -If you want to add an [`option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#option-class_method): +If you want to add an [`option`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#option-class_method): ```ruby class Yourformula < Formula @@ -730,7 +730,7 @@ class Yourformula < Formula ... ``` -And then to define the effects the [`option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#option-class_method)s have: +And then to define the effects the [`option`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#option-class_method)s have: ```ruby if build.with? "ham" @@ -742,9 +742,9 @@ if build.without? "ham" end ``` -[`option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#option-class_method) names should be prefixed with the words `with` or `without`. For example, an option to run a test suite should be named `--with-test` or `--with-check` rather than `--test`, and an option to enable a shared library `--with-shared` rather than `--shared` or `--enable-shared`. +[`option`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#option-class_method) names should be prefixed with the words `with` or `without`. For example, an option to run a test suite should be named `--with-test` or `--with-check` rather than `--test`, and an option to enable a shared library `--with-shared` rather than `--shared` or `--enable-shared`. -Note that [`option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#option-class_method)s that aren’t `build.with? ` or `build.without?` should be deprecated with [`deprecated_option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#deprecated_option-class_method). See [wget](https://github.com/Homebrew/homebrew-core/blob/master/Formula/wget.rb#L27-L31) for an example. +Note that [`option`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#option-class_method)s that aren’t `build.with? ` or `build.without?` should be deprecated with [`deprecated_option`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#deprecated_option-class_method). See [wget](https://github.com/Homebrew/homebrew-core/blob/master/Formula/wget.rb#L27-L31) for an example. ## File level operations @@ -771,7 +771,7 @@ For example, Ruby 1.9’s gems should be installed to `var/lib/ruby/` so that ge ### launchd plist files -Homebrew provides two Formula methods for launchd plist files. [`plist_name`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#plist_name-instance_method) will return e.g. `homebrew.mxcl.<formula>` and [`plist_path`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#plist_path-instance_method) will return e.g. `/usr/local/Cellar/foo/0.1/homebrew.mxcl.foo.plist`. +Homebrew provides two Formula methods for launchd plist files. [`plist_name`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#plist_name-instance_method) will return e.g. `homebrew.mxcl.<formula>` and [`plist_path`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#plist_path-instance_method) will return e.g. `/usr/local/Cellar/foo/0.1/homebrew.mxcl.foo.plist`. ## Updating formulae @@ -792,7 +792,7 @@ Homebrew wants to maintain a consistent Ruby style across all formulae based on ### Version detection fails -Homebrew tries to automatically determine the [`version`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#version-class_method) from the [`url`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#url-class_method) in avoid duplication. If the tarball has an unusual name you may need to manually assign the [`version`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#version-class_method). +Homebrew tries to automatically determine the [`version`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version-class_method) from the [`url`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#url-class_method) in avoid duplication. If the tarball has an unusual name you may need to manually assign the [`version`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#version-class_method). ## Bad Makefiles
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md
@@ -1,15 +1,15 @@ # How To Open a Homebrew Pull Request (and get it merged) The following commands are used by Homebrew's contributors to setup a fork of Homebrew's Git repository on GitHub, create a new branch and create a GitHub pull request of the changes in that branch. -Depending on the change you want to make, you need to send the pull request to the corresponding repository. If you want to submit a change in Homebrew core code, you should open the pull request at [Homebrew/homebrew](https://github.com/Homebrew/homebrew). If you want to apply any change on formula, you could open the pull request at [Homebrew core tap](https://github.com/Homebrew/homebrew-core) or any other [official taps](https://github.com/Homebrew) based on the nature of related formuale. +Depending on the change you want to make, you need to send the pull request to the corresponding repository. If you want to submit a change in Homebrew core code, you should open the pull request at [Homebrew/brew](https://github.com/Homebrew/brew). If you want to submit a change for a formula, you could open the pull request at [Homebrew core tap](https://github.com/Homebrew/homebrew-core) or any other [official taps](https://github.com/Homebrew) based the formula type. ## Set up your own fork of the Homebrew repository ### Core code related pull request 1. Change to the directory containing your Homebrew installation with `cd $(brew --repository)` -2. [Fork the Homebrew/homebrew repository](https://github.com/Homebrew/homebrew/fork) on GitHub. This creates a pushable, personal remote repository. This is needed as only Homebrew maintainers have push access to the main repository. -3. Add the pushable forked repository with `git remote add YOUR_USERNAME https://github.com/YOUR_USERNAME/homebrew.git` +2. [Fork the Homebrew/brew repository](https://github.com/Homebrew/brew/fork) on GitHub. This creates a pushable, personal remote repository. This is needed as only Homebrew maintainers have push access to the main repository. +3. Add the pushable forked repository with `git remote add YOUR_USERNAME https://github.com/YOUR_USERNAME/brew.git` ### Formulae related pull request
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/Installation.md
@@ -29,7 +29,7 @@ not build when installed elsewhere. One of the reasons Homebrew just works relative to the competition is **because** we recommend installing to `/usr/local`. *Pick another prefix at your peril!* -`mkdir homebrew && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C homebrew` +`mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew` ### Multiple installations Create a Homebrew installation wherever you extract the tarball. Whichever brew command is called is where the packages will be installed. You can use this as you see fit, e.g. a system set of libs in `/usr/local` and tweaked formulae for development in `~/homebrew`.
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/New-Maintainer-Checklist.md
@@ -25,8 +25,8 @@ A few requests: - still create your branches on your fork rather than in the main repository - if still in doubt please ask for help and we'll help you out - these are probably worth a read: - - https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md - - https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Maintainer-Guidelines.md + - https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md + - https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Maintainer-Guidelines.md - possibly everything else in the documentation How does that sound? @@ -42,7 +42,7 @@ If they accept, follow a few steps to get them set up: - [x] Add them to the [Jenkins' GitHub Pull Request Builder admin list](http://bot.brew.sh/configure) to enable `@BrewTestBot test this please` for them - [x] Invite them to the [`homebrew-dev` private maintainers mailing list](https://groups.google.com/forum/#!managemembers/homebrew-dev/invite) - [x] Invite them to the [`machomebrew` private maintainers Slack](https://machomebrew.slack.com/admin/invites) -- [x] Add them to [Homebrew's README](https://github.com/Homebrew/homebrew/edit/master/README.md) +- [x] Add them to [Homebrew's README](https://github.com/Homebrew/brew/edit/master/README.md) - [x] Encourage them to enable [GitHub's Two Factor Authentication](https://help.github.com/articles/about-two-factor-authentication/) After a few weeks/months with no problems consider making them [owners on the Homebrew GitHub organisation](https://github.com/orgs/Homebrew/people) and [administrators on Bintray](https://bintray.com/homebrew/organization/edit/members).
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/Querying-Brew.md
@@ -24,7 +24,7 @@ From the manpage: The current schema version is `v1`. Note that fields may be added to the schema as needed without incrementing the schema. Any significant breaking changes will cause a change to the schema version. -The schema itself is not currently documented outside of the code that generates it: [Formula#to_hash](https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/formula.rb#L443) +The schema itself is not currently documented outside of the code that generates it: [Formula#to_hash](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/formula.rb) (**TODO**: add a manpage for the schema)
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/Tips-N'-Tricks.md
@@ -6,11 +6,11 @@ The preferred and supported method of installing specific versions of formulae is to use the [homebrew/versions](https://github.com/Homebrew/homebrew-versions) tap. If the version you’re looking for isn’t available, consider [opening a -pull request](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md)! +pull request](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md)! ### Installing directly from pull-requests -You can browse pull requests https://github.com/Homebrew/homebrew/pulls +You can browse pull requests https://github.com/Homebrew/homebrew-core/pulls and install through the direct link. For example Python 3.3.0 pull request https://github.com/Homebrew/homebrew/pull/15199 ```sh
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/doc/homebrew/brew.1.html
@@ -73,7 +73,7 @@ <h2 id="COMMANDS">COMMANDS</h2> and version, but if it fails, you'll have to make your own template. The <code>wget</code> formula serves as a simple example. For the complete API have a look at</p> -<p><a href="http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula" data-bare-link="true">http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula</a></p> +<p><a href="http://www.rubydoc.info/github/Homebrew/brew/master/Formula" data-bare-link="true">http://www.rubydoc.info/github/Homebrew/brew/master/Formula</a></p> <p>If <code>--autotools</code> is passed, create a basic template for an Autotools-style build. If <code>--cmake</code> is passed, create a basic template for a CMake-style build.</p> @@ -153,7 +153,7 @@ <h2 id="COMMANDS">COMMANDS</h2> information on all installed formulae.</p> <p>See the docs for examples of using the JSON: -<a href="https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Querying-Brew.md" data-bare-link="true">https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Querying-Brew.md</a></p></dd> +<a href="https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Querying-Brew.md" data-bare-link="true">https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Querying-Brew.md</a></p></dd> <dt><code>install</code> [<code>--debug</code>] [<code>--env=</code><var>std</var>|<var>super</var>] [<code>--ignore-dependencies</code>] [<code>--only-dependencies</code>] [<code>--cc=</code><var>compiler</var>] [<code>--build-from-source</code>|<code>--force-bottle</code>] [<code>--devel</code>|<code>--HEAD</code>] <var>formula</var></dt><dd><p>Install <var>formula</var>.</p> <p><var>formula</var> is usually the name of the formula to install, but it can be specified @@ -314,7 +314,7 @@ <h2 id="COMMANDS">COMMANDS</h2> <p>Pass <code>--installed</code> to get information on installed taps.</p> <p>See the docs for examples of using the JSON: -<a href="https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Querying-Brew.md" data-bare-link="true">https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Querying-Brew.md</a></p></dd> +<a href="https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Querying-Brew.md" data-bare-link="true">https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Querying-Brew.md</a></p></dd> <dt><code>tap-pin</code> <var>tap</var></dt><dd><p>Pin <var>tap</var>, prioritizing its formulae over core when formula names are supplied by the user. See also <code>tap-unpin</code>.</p></dd> <dt><code>tap-unpin</code> <var>tap</var></dt><dd><p>Unpin <var>tap</var> so its formulae are no longer prioritized. See also <code>tap-pin</code>.</p></dd> @@ -402,7 +402,7 @@ <h2 id="EXTERNAL-COMMANDS">EXTERNAL COMMANDS</h2> to create your own commands without modifying Homebrew's internals.</p> <p>Instructions for creating your own commands can be found in the docs: -<a href="https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/External-Commands.md" data-bare-link="true">https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/External-Commands.md</a></p> +<a href="https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/External-Commands.md" data-bare-link="true">https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/External-Commands.md</a></p> <h2 id="SPECIFYING-FORMULAE">SPECIFYING FORMULAE</h2> @@ -527,7 +527,7 @@ <h2 id="USING-HOMEBREW-BEHIND-A-PROXY">USING HOMEBREW BEHIND A PROXY</h2> <h2 id="SEE-ALSO">SEE ALSO</h2> -<p>Homebrew Documentation: <a href="https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/" data-bare-link="true">https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/</a></p> +<p>Homebrew Documentation: <a href="https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/" data-bare-link="true">https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/</a></p> <p><code>git</code>(1), <code>git-log</code>(1)</p> @@ -542,7 +542,7 @@ <h2 id="BUGS">BUGS</h2> <p>See our issues on GitHub:</p> <ul> -<li><p>Homebrew <a href="https://github.com/Homebrew/homebrew/issues" data-bare-link="true">https://github.com/Homebrew/homebrew/issues</a></p></li> +<li><p>Homebrew/brew <a href="https://github.com/Homebrew/brew/issues" data-bare-link="true">https://github.com/Homebrew/brew/issues</a></p></li> <li><p>Homebrew/homebrew-core <a href="https://github.com/Homebrew/homebrew-core/issues" data-bare-link="true">https://github.com/Homebrew/homebrew-core/issues</a></p></li> </ul>
true
Other
Homebrew
brew
276a797d37fa057f935ba671bca04163389046f1.json
Update documentation after repository split.
share/man/man1/brew.1
@@ -96,7 +96,7 @@ Show Homebrew and system configuration useful for debugging\. If you file a bug Generate a formula for the downloadable file at \fIURL\fR and open it in the editor\. Homebrew will attempt to automatically derive the formula name and version, but if it fails, you\'ll have to make your own template\. The \fBwget\fR formula serves as a simple example\. For the complete API have a look at . .IP -\fIhttp://www\.rubydoc\.info/github/Homebrew/homebrew/master/Formula\fR +\fIhttp://www\.rubydoc\.info/github/Homebrew/brew/master/Formula\fR . .IP If \fB\-\-autotools\fR is passed, create a basic template for an Autotools\-style build\. If \fB\-\-cmake\fR is passed, create a basic template for a CMake\-style build\. @@ -211,7 +211,7 @@ Print a JSON representation of \fIformulae\fR\. Currently the only accepted valu Pass \fB\-\-all\fR to get information on all formulae, or \fB\-\-installed\fR to get information on all installed formulae\. . .IP -See the docs for examples of using the JSON: \fIhttps://github\.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Querying\-Brew\.md\fR +See the docs for examples of using the JSON: \fIhttps://github\.com/Homebrew/brew/blob/master/share/doc/homebrew/Querying\-Brew\.md\fR . .TP \fBinstall\fR [\fB\-\-debug\fR] [\fB\-\-env=\fR\fIstd\fR|\fIsuper\fR] [\fB\-\-ignore\-dependencies\fR] [\fB\-\-only\-dependencies\fR] [\fB\-\-cc=\fR\fIcompiler\fR] [\fB\-\-build\-from\-source\fR|\fB\-\-force\-bottle\fR] [\fB\-\-devel\fR|\fB\-\-HEAD\fR] \fIformula\fR @@ -442,7 +442,7 @@ Print a JSON representation of \fItaps\fR\. Currently the only accepted value fo Pass \fB\-\-installed\fR to get information on installed taps\. . .IP -See the docs for examples of using the JSON: \fIhttps://github\.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Querying\-Brew\.md\fR +See the docs for examples of using the JSON: \fIhttps://github\.com/Homebrew/brew/blob/master/share/doc/homebrew/Querying\-Brew\.md\fR . .TP \fBtap\-pin\fR \fItap\fR @@ -577,7 +577,7 @@ Print the version number of brew to standard error and exit\. Homebrew, like \fBgit\fR(1), supports external commands\. These are executable scripts that reside somewhere in the \fBPATH\fR, named \fBbrew\-\fR\fIcmdname\fR or \fBbrew\-\fR\fIcmdname\fR\fB\.rb\fR, which can be invoked like \fBbrew\fR \fIcmdname\fR\. This allows you to create your own commands without modifying Homebrew\'s internals\. . .P -Instructions for creating your own commands can be found in the docs: \fIhttps://github\.com/Homebrew/homebrew/blob/master/share/doc/homebrew/External\-Commands\.md\fR +Instructions for creating your own commands can be found in the docs: \fIhttps://github\.com/Homebrew/brew/blob/master/share/doc/homebrew/External\-Commands\.md\fR . .SH "SPECIFYING FORMULAE" Many Homebrew commands accept one or more \fIformula\fR arguments\. These arguments can take several different forms: @@ -756,7 +756,7 @@ http_proxy=http://<user>:<password>@<host>:<port> brew install foo .IP "" 0 . .SH "SEE ALSO" -Homebrew Documentation: \fIhttps://github\.com/Homebrew/homebrew/blob/master/share/doc/homebrew/\fR +Homebrew Documentation: \fIhttps://github\.com/Homebrew/brew/blob/master/share/doc/homebrew/\fR . .P \fBgit\fR(1), \fBgit\-log\fR(1) @@ -771,9 +771,10 @@ Former maintainers with significant contributions include Jack Nagel, Adam Vande See our issues on GitHub: . .IP "\(bu" 4 -Homebrew \fIhttps://github\.com/Homebrew/homebrew/issues\fR +Homebrew/brew \fIhttps://github\.com/Homebrew/brew/issues\fR . .IP "\(bu" 4 Homebrew/homebrew\-core \fIhttps://github\.com/Homebrew/homebrew\-core/issues\fR . .IP "" 0 +
true
Other
Homebrew
brew
e70a3552d3faddd0afd2535a03c31b8c50be901a.json
test-bot: exclude Taps dir from root cleanup
Library/Homebrew/cmd/test-bot.rb
@@ -645,7 +645,7 @@ def cleanup_before safe_system "git", "checkout", "-f", "master" # This will uninstall all formulae, as long as # HOMEBREW_REPOSITORY == HOMEBREW_PREFIX, which is true on the test bots - safe_system "git", "clean", "-ffdx" unless ENV["HOMEBREW_RUBY"] == "1.8.7" + safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/" unless ENV["HOMEBREW_RUBY"] == "1.8.7" end pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock" Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock } @@ -669,7 +669,7 @@ def cleanup_after test "git", "clean", "-ffdx" HOMEBREW_REPOSITORY.cd do safe_system "git", "reset", "--hard" - safe_system "git", "clean", "-ffdx" + safe_system "git", "clean", "-ffdx", "--exclude=/Library/Taps/" end if ARGV.include? "--local" FileUtils.rm_rf ENV["HOMEBREW_HOME"]
false
Other
Homebrew
brew
232eccc4285712697d66f72bd39fa196b5ba1f98.json
test-bot: fix path in cleanup_before We should remove PR lock files in the test tap rather than HOMEBREW_REPOSITORY.
Library/Homebrew/cmd/test-bot.rb
@@ -640,7 +640,7 @@ def cleanup_before git "reset", "--hard" git "checkout", "-f", "master" git "clean", "-ffdx" unless ENV["HOMEBREW_RUBY"] == "1.8.7" - pr_locks = "#{HOMEBREW_REPOSITORY}/.git/refs/remotes/*/pr/*/*.lock" + pr_locks = "#{@repository}/.git/refs/remotes/*/pr/*/*.lock" Dir.glob(pr_locks) { |lock| FileUtils.rm_rf lock } end
false
Other
Homebrew
brew
9f79c05656a44f926898774c6029025002bcd621.json
diagnostic: improve check for 'install_name_tool' `install_name_tool` location depends on the location of the active developer directory managed by `xcode-select`. Closes Homebrew/homebrew#50509. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/diagnostic.rb
@@ -454,13 +454,15 @@ def check_for_stray_developer_directory def check_for_bad_install_name_tool return if MacOS.version < "10.9" - libs = Pathname.new("/usr/bin/install_name_tool").dynamically_linked_libraries + install_name_tool = OS::Mac.install_name_tool + libs = Pathname.new(install_name_tool).dynamically_linked_libraries # otool may not work, for example if the Xcode license hasn't been accepted yet return if libs.empty? - unless libs.include? "/usr/lib/libxcselect.dylib" then <<-EOS.undent - You have an outdated version of /usr/bin/install_name_tool installed. + expectedLibs = ["/usr/lib/libSystem.B.dylib", "/usr/lib/libxcselect.dylib"] + if (libs & expectedLibs).empty? then <<-EOS.undent + You have an outdated version of #{install_name_tool} installed. This will cause binary package installations to fail. This can happen if you install osx-gcc-installer or RailsInstaller. To restore it, you must reinstall OS X or restore the binary from
false
Other
Homebrew
brew
bdd26d04468e6bbd3cf5e9841a1f163d33884e67.json
test-bot: ensure tap is full clone
Library/Homebrew/cmd/test-bot.rb
@@ -874,9 +874,17 @@ def test_bot p ARGV tap = resolve_test_tap - # Tap repository if required, this is done before everything else - # because Formula parsing and/or git commit hash lookup depends on it. - safe_system "brew", "tap", tap.name unless tap.installed? + if tap.installed? + # make sure Tap is not a shallow clone. + # bottle revision and bottle upload rely on full clone. + if (tap.path/".git/shallow").exist? + safe_system "git", "-C", tap.path, "fetch", "--unshallow" + end + else + # Tap repository if required, this is done before everything else + # because Formula parsing and/or git commit hash lookup depends on it. + safe_system "brew", "tap", tap.name, "--full" + end if ARGV.include? "--ci-upload" return test_ci_upload(tap)
false
Other
Homebrew
brew
deed8e566c096da391a92060f19e5093ec3cd1f6.json
test-bot: handle legacy formulae PR from Homebrew/homebrew Closes Homebrew/homebrew#50635. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/cmd/test-bot.rb
@@ -11,6 +11,8 @@ # --junit: Generate a JUnit XML test results file. # --no-bottle: Run brew install without --build-bottle # --keep-old: Run brew bottle --keep-old to build new bottles for a single platform. +# --legacy Bulid formula from legacy Homebrew/homebrew repo. +# (TODO remove it when it's not longer necessary) # --HEAD: Run brew install with --HEAD # --local: Ask Homebrew to write verbose logs under ./logs/ and set HOME to ./home/ # --tap=<tap>: Use the git repository of the given tap @@ -329,7 +331,11 @@ def diff_formulae(start_revision, end_revision, path, filter) # the right commit to BrewTestBot. unless travis_pr diff_start_sha1 = current_sha1 - test "brew", "pull", "--clean", @url + if ARGV.include?("--legacy") + test "brew", "pull", "--clean", "--legacy", @url + else + test "brew", "pull", "--clean", @url + end diff_end_sha1 = current_sha1 end @short_url = @url.gsub("https://github.com/", "") @@ -747,6 +753,7 @@ def test_ci_upload(tap) ARGV << "--verbose" ARGV << "--keep-old" if ENV["UPSTREAM_BOTTLE_KEEP_OLD"] + ARGV << "--legacy" if ENV["UPSTREAM_BOTTLE_LEGACY"] bottles = Dir["#{jenkins}/jobs/#{job}/configurations/axis-version/*/builds/#{id}/archive/*.bottle*.*"] return if bottles.empty? @@ -767,8 +774,13 @@ def test_ci_upload(tap) safe_system "brew", "update" if pr - pull_pr = "https://github.com/#{tap.user}/homebrew-#{tap.repo}/pull/#{pr}" - safe_system "brew", "pull", "--clean", pull_pr + if ARGV.include?("--legacy") + pull_pr = "https://github.com/Homebrew/homebrew/pull/#{pr}" + safe_system "brew", "pull", "--clean", "--legacy", pull_pr + else + pull_pr = "https://github.com/#{tap.user}/homebrew-#{tap.repo}/pull/#{pr}" + safe_system "brew", "pull", "--clean", pull_pr + end end bottle_args = ["--merge", "--write", *Dir["*.bottle.rb"]]
false
Other
Homebrew
brew
2bb30fc5f0ab4146190e65d017ea0ad4eac40dbf.json
--version/config: show core tap information
Library/Homebrew/cmd/config.rb
@@ -1,6 +1,7 @@ require "hardware" require "software_spec" require "rexml/document" +require "tap" module Homebrew def config @@ -57,6 +58,18 @@ def origin Homebrew.git_origin || "(none)" end + def core_tap_head + CoreTap.instance.git_head || "(none)" + end + + def core_tap_last_commit + CoreTap.instance.git_last_commit || "never" + end + + def core_tap_origin + CoreTap.instance.remote || "(none)" + end + def describe_path(path) return "N/A" if path.nil? realpath = path.realpath @@ -144,6 +157,13 @@ def dump_verbose_config(f = $stdout) f.puts "ORIGIN: #{origin}" f.puts "HEAD: #{head}" f.puts "Last commit: #{last_commit}" + if CoreTap.instance.installed? + f.puts "Core tap ORIGIN: #{core_tap_origin}" + f.puts "Core tap HEAD: #{core_tap_head}" + f.puts "Core tap last commit: #{core_tap_last_commit}" + else + f.puts "Core tap: N/A" + end f.puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" f.puts "HOMEBREW_REPOSITORY: #{HOMEBREW_REPOSITORY}" f.puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}"
true
Other
Homebrew
brew
2bb30fc5f0ab4146190e65d017ea0ad4eac40dbf.json
--version/config: show core tap information
Library/Homebrew/utils.rb
@@ -229,6 +229,18 @@ def self.homebrew_version_string end end + def self.core_tap_version_string + require "tap" + tap = CoreTap.instance + return "N/A" unless tap.installed? + if pretty_revision = tap.git_short_head + last_commit = tap.git_last_commit_date + "(git revision #{pretty_revision}; last commit #{last_commit})" + else + "(no git repository)" + end + end + def self.install_gem_setup_path!(gem, version = nil, executable = gem) require "rubygems"
true
Other
Homebrew
brew
2bb30fc5f0ab4146190e65d017ea0ad4eac40dbf.json
--version/config: show core tap information
Library/brew.rb
@@ -7,6 +7,7 @@ if ARGV == %w[--version] || ARGV == %w[-v] puts "Homebrew #{Homebrew.homebrew_version_string}" + puts "Homebrew/homebrew-core #{Homebrew.core_tap_version_string}" exit 0 end
true
Other
Homebrew
brew
63c0a9fa92c100e505cc2a53e752b5a448c61473.json
Tap#install: set autocrlf to false Ensure we don't munge line endings on checkout regardless with user's global git config. Closes Homebrew/homebrew#50514. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/tap.rb
@@ -182,7 +182,7 @@ def install(options = {}) Utils.ensure_git_installed! ohai "Tapping #{name}" unless quiet remote = options[:clone_target] || "https://github.com/#{user}/homebrew-#{repo}" - args = %W[clone #{remote} #{path}] + args = %W[clone #{remote} #{path} --config core.autocrlf=false] args << "--depth=1" unless options.fetch(:full_clone, false) args << "-q" if quiet
false
Other
Homebrew
brew
a87eb23a3b613de803f249aee2c9941f5190aef6.json
bump-formula-pr: fix typo in spec existence check Closes Homebrew/homebrew#50472. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -25,7 +25,7 @@ def bump_formula_pr else [:stable, formula.stable] end - odie "#{formula}: no #{requested_spec} specification found!" unless formula + odie "#{formula}: no #{requested_spec} specification found!" unless formula_spec hash_type, old_hash = if (checksum = formula_spec.checksum) [checksum.hash_type.to_s, checksum.hexdigest]
false
Other
Homebrew
brew
6135da800e4f93ded3a5a331d0efa691f4822afb.json
utils, gist-logs: improve/fix credential handling. The API used (`Net::HTTP::Post`) does not handle basic authentication credentials in the same way as `open` so fix both cases so they work. Also, do some general usability tweaks to point out to people what could be wrong with their tokens or credentials to help them debug. Closes Homebrew/homebrew#50410. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/gist-logs.rb
@@ -37,12 +37,12 @@ def gistify_logs(f) if ARGV.include?("--new-issue") || ARGV.switch?("n") auth = :AUTH_TOKEN - unless GitHub.api_credentials + if GitHub.api_credentials_type == :none puts "You can create a personal access token: https://github.com/settings/tokens" puts "and then set HOMEBREW_GITHUB_API_TOKEN as authentication method." puts - auth = :AUTH_BASIC + auth = :AUTH_USER_LOGIN end url = new_issue(f.tap, "#{f.name} failed to build on #{MacOS.full_version}", url, auth) @@ -118,9 +118,21 @@ def make_request(path, data, auth) headers = GitHub.api_headers headers["Content-Type"] = "application/json" + basic_auth_credentials = nil + if auth != :AUTH_USER_LOGIN + token, username = GitHub.api_credentials + case GitHub.api_credentials_type + when :keychain + basic_auth_credentials = [username, token] + when :environment + headers["Authorization"] = "token #{token}" + end + end + request = Net::HTTP::Post.new(path, headers) + request.basic_auth(*basic_auth_credentials) if basic_auth_credentials - login(request) if auth == :AUTH_BASIC + login(request) if auth == :AUTH_USER_LOGIN request.body = Utils::JSON.dump(data) request @@ -133,6 +145,7 @@ def post(path, data, auth = nil) when Net::HTTPCreated Utils::JSON.load get_body(response) else + GitHub.api_credentials_error_message(response) raise "HTTP #{response.code} #{response.message} (expected 201)" end end
true
Other
Homebrew
brew
6135da800e4f93ded3a5a331d0efa691f4822afb.json
utils, gist-logs: improve/fix credential handling. The API used (`Net::HTTP::Post`) does not handle basic authentication credentials in the same way as `open` so fix both cases so they work. Also, do some general usability tweaks to point out to people what could be wrong with their tokens or credentials to help them debug. Closes Homebrew/homebrew#50410. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/utils.rb
@@ -484,7 +484,7 @@ module GitHub class RateLimitExceededError < Error def initialize(reset, error) super <<-EOS.undent - GitHub #{error} + GitHub API Error: #{error} Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token: #{Tty.em}https://github.com/settings/tokens/new?scopes=&description=Homebrew#{Tty.reset} and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token" @@ -506,9 +506,12 @@ def initialize(error) EOS else message << <<-EOS.undent - The GitHub credentials in the OS X keychain are invalid. + The GitHub credentials in the OS X keychain may be invalid. Clear them with: printf "protocol=https\\nhost=github.com\\n" | git credential-osxkeychain erase + Or create a personal access token: + #{Tty.em}https://github.com/settings/tokens/new?scopes=&description=Homebrew#{Tty.reset} + and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token" EOS end super message @@ -536,32 +539,71 @@ def api_credentials end end - def api_headers - @api_headers ||= begin - headers = { - "User-Agent" => HOMEBREW_USER_AGENT, - "Accept" => "application/vnd.github.v3+json" - } - token, username = api_credentials - if token && !token.empty? - if username && !username.empty? - headers[:http_basic_authentication] = [username, token] - else - headers["Authorization"] = "token #{token}" + def api_credentials_type + token, username = api_credentials + if token && !token.empty? + if username && !username.empty? + :keychain + else + :environment + end + else + :none + end + end + + def api_credentials_error_message(response_headers) + @api_credentials_error_message_printed ||= begin + unauthorized = (response_headers["status"] == "401 Unauthorized") + scopes = response_headers["x-accepted-oauth-scopes"].to_s.split(", ") + if !unauthorized && scopes.empty? + credentials_scopes = response_headers["x-oauth-scopes"].to_s.split(", ") + + case GitHub.api_credentials_type + when :keychain + onoe <<-EOS.undent + Your OS X keychain GitHub credentials do not have sufficient scope! + Scopes they have: #{credentials_scopes} + Create a personal access token: https://github.com/settings/tokens + and then set HOMEBREW_GITHUB_API_TOKEN as the authentication method instead. + EOS + when :environment + onoe <<-EOS.undent + Your HOMEBREW_GITHUB_API_TOKEN does not have sufficient scope! + Scopes it has: #{credentials_scopes} + Create a new personal access token: https://github.com/settings/tokens + and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method instead. + EOS end end - headers + true end end + def api_headers + { + "User-Agent" => HOMEBREW_USER_AGENT, + "Accept" => "application/vnd.github.v3+json" + } + end + def open(url, &_block) # This is a no-op if the user is opting out of using the GitHub API. return if ENV["HOMEBREW_NO_GITHUB_API"] require "net/https" + headers = api_headers + token, username = api_credentials + case api_credentials_type + when :keychain + headers[:http_basic_authentication] = [username, token] + when :environment + headers["Authorization"] = "token #{token}" + end + begin - Kernel.open(url, api_headers) { |f| yield Utils::JSON.load(f.read) } + Kernel.open(url, headers) { |f| yield Utils::JSON.load(f.read) } rescue OpenURI::HTTPError => e handle_api_error(e) rescue EOFError, SocketError, OpenSSL::SSL::SSLError => e @@ -578,6 +620,8 @@ def handle_api_error(e) raise RateLimitExceededError.new(reset, error) end + GitHub.api_credentials_error_message(e.io.meta) + case e.io.status.first when "401", "403" raise AuthenticationFailedError.new(e.message)
true
Other
Homebrew
brew
ca2abb2be6686a8f2e7c64f5d334ab70be97a1b7.json
bump-formula-pr: add new command. Add a new developer command (i.e. requires `HOMEBREW_DEVELOPER` set in your environment) to bump the version of a formula and create a new pull request with the new version. Closes Homebrew/homebrew#49848.
Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -0,0 +1,114 @@ +# Creates a pull request with the new version of a formula. +# +# Usage: brew bump [options...] <formula-name> +# +# Requires either `--url` and `--sha256` or `--tag` and `--revision`. +# +# Options: +# --dry-run: Print what would be done rather than doing it. +# --devel: Bump a `devel` rather than `stable` version. +# --url: The new formula URL. +# --sha256: The new formula SHA-256. +# --tag: The new formula's `tag` +# --revision: The new formula's `revision`. + +require "formula" + +module Homebrew + def bump_formula_pr + formula = ARGV.formulae.first + odie "No formula found!" unless formula + + requested_spec, formula_spec = if ARGV.include?("--devel") + devel_message = " (devel)" + [:devel, formula.devel] + else + [:stable, formula.stable] + end + odie "#{formula}: no #{requested_spec} specification found!" unless formula + + hash_type, old_hash = if (checksum = formula_spec.checksum) + [checksum.hash_type.to_s, checksum.hexdigest] + end + + new_url = ARGV.value("url") + new_hash = ARGV.value(hash_type) + new_tag = ARGV.value("tag") + new_revision = ARGV.value("revision") + new_url_hash = if new_url && new_hash + true + elsif new_tag && new_revision + false + elsif !hash_type + odie "#{formula}: no tag/revision specified!" + else + odie "#{formula}: no url/#{hash_type} specified!" + end + + if ARGV.dry_run? + ohai "brew update" + else + safe_system "brew", "update" + end + + Utils::Inreplace.inreplace(formula.path) do |s| + if new_url_hash + old_url = formula_spec.url + if ARGV.dry_run? + ohai "replace '#{old_url}' with '#{new_url}'" + ohai "replace '#{old_hash}' with '#{new_hash}'" + else + s.gsub!(old_url, new_url) + s.gsub!(old_hash, new_hash) + end + else + resource_specs = formula_spec.specs + old_tag = resource_specs[:tag] + old_revision = resource_specs[:revision] + if ARGV.dry_run? + ohai "replace '#{old_tag}' with '#{new_tag}'" + ohai "replace '#{old_revision}' with '#{new_revision}'" + else + s.gsub!(/['"]#{old_tag}['"]/, "\"#{new_tag}\"") + s.gsub!(old_revision, new_revision) + end + end + end + + new_formula = Formulary.load_formula_from_path(formula.name, formula.path) + new_formula_version = new_formula.version + + unless Formula["hub"].any_version_installed? + if ARGV.dry_run? + ohai "brew install hub" + else + safe_system "brew", "install", "hub" + end + end + + formula.path.parent.cd do + branch = "#{formula.name}-#{new_formula_version}" + if ARGV.dry_run? + ohai "git checkout -b #{branch} origin/master" + ohai "git commit --no-edit --verbose --message='#{formula.name} #{new_formula_version}#{devel_message}' -- #{formula.path}" + ohai "hub fork --no-remote" + ohai "hub fork" + ohai "hub fork (to read $HUB_REMOTE)" + ohai "git push $HUB_REMOTE #{branch}:#{branch}" + ohai "hub pull-request --browse -m '#{formula.name} #{new_formula_version}#{devel_message}'" + else + safe_system "git", "checkout", "-b", branch, "origin/master" + safe_system "git", "commit", "--no-edit", "--verbose", + "--message=#{formula.name} #{new_formula_version}#{devel_message}", + "--", formula.path + safe_system "hub", "fork", "--no-remote" + quiet_system "hub", "fork" + remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists./, 1] + odie "cannot get remote from 'hub'!" if remote.to_s.empty? + safe_system "git", "push", remote, "#{branch}:#{branch}" + safe_system "hub", "pull-request", "--browse", "-m", + "#{formula.name} #{new_formula_version}#{devel_message}\n\nCreated with `brew bump-formula-pr`." + end + end + end +end
false
Other
Homebrew
brew
eda70673ea695013480ffec285257e28a86c0203.json
Fix backticks to prevent missing rendered text The backticks being where they were, or not, caused text like `<formula>` to not be shown when viewing the rendered text in a browser. Closes Homebrew/homebrew#50428. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
share/doc/homebrew/Querying-Brew.md
@@ -15,8 +15,8 @@ To enable users to do rich queries without the problems above, Homebrew provides From the manpage: - * `info --json=<version>` (--all|--installed|<formula>): - Print a JSON representation of <formula>. Currently the only accepted value + * `info --json=<version> (--all|--installed|<formula>)`: + Print a JSON representation of `<formula>`. Currently the only accepted value for <version> is `v1`. Pass `--all` to get information on all formulae, or `--installed` to get
false
Other
Homebrew
brew
b896629da40177a1a9c6c0c6ed05889110fef817.json
connect 1.105 (migrate from boneyard) connect is a utility that provides SOCKS and HTTPS proxy support to SSH. I have created a new formula for version 1.104 that works unlike the formula for 1.100 that is currently in the boneyard. Closes Homebrew/homebrew#49716. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
Library/Homebrew/tap_migrations.rb
@@ -32,7 +32,6 @@ "clusterit" => "homebrew/x11", "cmucl" => "homebrew/binary", "comparepdf" => "homebrew/boneyard", - "connect" => "homebrew/boneyard", "coremod" => "homebrew/boneyard", "curlftpfs" => "homebrew/x11", "cwm" => "homebrew/x11",
false
Other
Homebrew
brew
760c596a8e75c6126e95cb9897eb9b66faffbb0c.json
Checksum_Deprecation: add guiding document Closes Homebrew/homebrew#50282. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
share/doc/homebrew/Checksum_Deprecation.md
@@ -0,0 +1,27 @@ +# Checksum Deprecation + +During early 2015 Homebrew started the process of deprecating _SHA1_ for package +integrity verification. Since then every formulae under the Homebrew organisation +has been moved onto _SHA256_ verification; this includes both source packages +and our precompiled packages (bottles). + +We also stopped supporting _MD5_ entirely. It was removed from core formulae in 2012 but until April 2015 if you tried to install a formula still using an +_MD5_ checksum Homebrew wouldn't actively stop you. + +On _SHA1_ we added a `brew audit` check that flags _SHA1_ checksums as deprecated +and requests that you use _SHA256_. + +We saw positive ecosystem engagement on moving from _MD5_ & _SHA1_ to the recommended _SHA256_ and thanks to that we're in a strong position to move forwards. + +## Moving forwards on SHA1. + +From March 20th 2016 we've stepped up the visibility of that notification & you'll start +seeing deprecation warnings when installing _SHA1_-validated formula. +If you see these please consider reporting it to where the formula originated. + +We're targeting **the end of September 2016** for _SHA1_ support removal, +19 months after we started warning people to move away from it for verification. +This will be enforced in the same way _MD5_ is today, by blocking the installation of that individual formula until the checksum is migrated. + +This means prior to that date custom taps, local custom formulae, etc +need to be migrated to use _SHA256_.
false
Other
Homebrew
brew
478f18a8f57705a0c16b27b257f022f91c0b630b.json
software_spec: add ExternalPatch to dependency_collector Since we support `apply` DSL in the `patch` block, external patch files could be any compressed archive. As result, it could introduce dependencies like xz, 7z etc. Add the resource of ExternalPatch to dependency_collector, so we could track these resource dependencies. Closes Homebrew/homebrew#50318. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/software_spec.rb
@@ -165,7 +165,9 @@ def requirements end def patch(strip = :p1, src = nil, &block) - patches << Patch.create(strip, src, &block) + p = Patch.create(strip, src, &block) + dependency_collector.add(p.resource) if p.is_a? ExternalPatch + patches << p end def fails_with(compiler, &block)
false
Other
Homebrew
brew
ca5b7440c69a37b5f03f7b8949df27d8824d307d.json
diagnostic: make `chown` recommendation consistent This is the only place we advise `:admin` as well so might as well change this one. Closes Homebrew/homebrew#50279. Closes Homebrew/homebrew#50295. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
Library/Homebrew/diagnostic.rb
@@ -523,7 +523,7 @@ def check_access_usr_local You should probably change the ownership and permissions of /usr/local back to your user account. - sudo chown -R $(whoami):admin /usr/local + sudo chown -R $(whoami) /usr/local EOS end end
false
Other
Homebrew
brew
142be05c0f6070c71fa3dc38e86711bdca372fb5.json
diagnostic: trim unnecessary 'the'
Library/Homebrew/diagnostic.rb
@@ -501,7 +501,7 @@ def check_access_share_man def check_access_homebrew_repository unless HOMEBREW_REPOSITORY.writable_real? then <<-EOS.undent - The #{HOMEBREW_REPOSITORY} is not writable. + #{HOMEBREW_REPOSITORY} is not writable. You should probably change the ownership and permissions of #{HOMEBREW_REPOSITORY} back to your user account. @@ -514,7 +514,7 @@ def check_access_usr_local return unless HOMEBREW_PREFIX.to_s == "/usr/local" unless HOMEBREW_PREFIX.writable_real? then <<-EOS.undent - The /usr/local directory is not writable. + /usr/local is not writable. Even if this directory was writable when you installed Homebrew, other software may change permissions on this directory. For example, upgrading to OS X El Capitan has been known to do this. Some versions of the
false
Other
Homebrew
brew
99155c3b5fb7f956b40d35f3723bfae97c8dc06b.json
update: use git from ENV/scm/git The idea is to let `scm/git` to handle all of git location resolution throughout Homebrew codebase. Closes Homebrew/homebrew#50116. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/cmd/update.sh
@@ -3,42 +3,7 @@ brew() { } git() { - [[ -n "$HOMEBREW_GIT" ]] || odie "HOMEBREW_GIT is unset!" - "$HOMEBREW_GIT" "$@" -} - -which_git() { - local git_path - local active_developer_dir - - if [[ -n "$HOMEBREW_GIT" ]] - then - git_path="$HOMEBREW_GIT" - elif [[ -n "$GIT" ]] - then - git_path="$GIT" - else - git_path="git" - fi - - git_path="$(which "$git_path" 2>/dev/null)" - - if [[ -n "$git_path" ]] - then - git_path="$(chdir "${git_path%/*}" && pwd -P)/${git_path##*/}" - fi - - if [[ -n "$HOMEBREW_OSX" && "$git_path" = "/usr/bin/git" ]] - then - active_developer_dir="$('/usr/bin/xcode-select' -print-path 2>/dev/null)" - if [[ -n "$active_developer_dir" && -x "$active_developer_dir/usr/bin/git" ]] - then - git_path="$active_developer_dir/usr/bin/git" - else - git_path="" - fi - fi - echo "$git_path" + "$HOMEBREW_LIBRARY/ENV/scm/git" "$@" } git_init_if_necessary() { @@ -291,12 +256,10 @@ EOS odie "$HOMEBREW_REPOSITORY must be writable!" fi - HOMEBREW_GIT="$(which_git)" - if [[ -z "$HOMEBREW_GIT" ]] + if ! git --version >/dev/null 2>&1 then brew install git - HOMEBREW_GIT="$(which_git)" - if [[ -z "$HOMEBREW_GIT" ]] + if ! git --version >/dev/null 2>&1 then odie "Git must be installed and in your PATH!" fi
false
Other
Homebrew
brew
ce7b32cec835bb658df75a0c691db9a97921163c.json
add HOMEBREW_ENV_PATH internal variable `Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It should be able to be accessed during the `brew tests`. By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these codes.
Library/Homebrew/config.rb
@@ -39,6 +39,7 @@ def mkpath HOMEBREW_REPOSITORY = Pathname.new(ENV["HOMEBREW_REPOSITORY"]) HOMEBREW_LIBRARY = Pathname.new(ENV["HOMEBREW_LIBRARY"]) +HOMEBREW_ENV_PATH = HOMEBREW_LIBRARY/"ENV" HOMEBREW_CONTRIB = HOMEBREW_REPOSITORY/"Library/Contributions" # Where we store built products
true
Other
Homebrew
brew
ce7b32cec835bb658df75a0c691db9a97921163c.json
add HOMEBREW_ENV_PATH internal variable `Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It should be able to be accessed during the `brew tests`. By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these codes.
Library/Homebrew/extend/ENV/std.rb
@@ -77,7 +77,7 @@ def determine_pkg_config_libdir paths = [] paths << "#{HOMEBREW_PREFIX}/lib/pkgconfig" paths << "#{HOMEBREW_PREFIX}/share/pkgconfig" - paths << "#{HOMEBREW_LIBRARY}/ENV/pkgconfig/#{MacOS.version}" + paths << "#{HOMEBREW_ENV_PATH}/pkgconfig/#{MacOS.version}" paths << "/usr/lib/pkgconfig" paths.select { |d| File.directory? d }.join(File::PATH_SEPARATOR) end
true
Other
Homebrew
brew
ce7b32cec835bb658df75a0c691db9a97921163c.json
add HOMEBREW_ENV_PATH internal variable `Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It should be able to be accessed during the `brew tests`. By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these codes.
Library/Homebrew/extend/ENV/super.rb
@@ -28,7 +28,7 @@ def self.extended(base) def self.bin return unless MacOS.has_apple_developer_tools? - bin = (HOMEBREW_REPOSITORY/"Library/ENV").subdirs.reject { |d| d.basename.to_s > MacOS::Xcode.version }.max + bin = HOMEBREW_ENV_PATH.subdirs.reject { |d| d.basename.to_s > MacOS::Xcode.version }.max bin.realpath unless bin.nil? end @@ -150,7 +150,7 @@ def determine_pkg_config_path end def determine_pkg_config_libdir - paths = %W[/usr/lib/pkgconfig #{HOMEBREW_LIBRARY}/ENV/pkgconfig/#{MacOS.version}] + paths = %W[/usr/lib/pkgconfig #{HOMEBREW_ENV_PATH}/pkgconfig/#{MacOS.version}] paths << "#{MacOS::X11.lib}/pkgconfig" << "#{MacOS::X11.share}/pkgconfig" if x11? paths.to_path_s end
true
Other
Homebrew
brew
ce7b32cec835bb658df75a0c691db9a97921163c.json
add HOMEBREW_ENV_PATH internal variable `Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It should be able to be accessed during the `brew tests`. By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these codes.
Library/Homebrew/test/lib/config.rb
@@ -14,6 +14,7 @@ HOMEBREW_REPOSITORY = HOMEBREW_PREFIX HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY+"Library" HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../..", __FILE__)) +HOMEBREW_ENV_PATH = HOMEBREW_LIBRARY_PATH.parent+"ENV" HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":") HOMEBREW_CACHE = HOMEBREW_PREFIX.parent+"cache" HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache"
true
Other
Homebrew
brew
ce7b32cec835bb658df75a0c691db9a97921163c.json
add HOMEBREW_ENV_PATH internal variable `Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It should be able to be accessed during the `brew tests`. By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these codes.
Library/Homebrew/test/testing_env.rb
@@ -6,7 +6,7 @@ require "formulary" # Test environment setup -%w[ENV Formula].each { |d| HOMEBREW_LIBRARY.join(d).mkpath } +HOMEBREW_LIBRARY.join("Formula").mkpath %w[cache formula_cache cellar logs].each { |d| HOMEBREW_PREFIX.parent.join(d).mkpath } # Test fixtures and files can be found relative to this path
true