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 | 557f6e33a9496513006a3ec69f9d3f3d0450e9e5.json | audit: check resource placement | Library/Homebrew/cmd/audit.rb | @@ -186,6 +186,7 @@ def audit_file
[/^ keg_only/, "keg_only"],
[/^ option/, "option"],
[/^ depends_on/, "depends_on"],
+ [/^ (go_)?resource/, "resource"],
[/^ def install/, "install meth... | false |
Other | Homebrew | brew | 9cab3011856d0d4308054887f7459dc91e444ed3.json | diagnostic: improve check for 'gnubin' in PATH
Both `coreutils` and `findutils` suggest to add `#{opt_libexec}/gnubin`
to PATH in their caveats to get the non-prefixed binaries from those
formulae. Check this in addition to the version-specific directory that
is less likely to be in PATH.
Closes Homebrew/homebrew#482... | Library/Homebrew/diagnostic.rb | @@ -1198,20 +1198,28 @@ def check_for_bad_python_symlink
end
def check_for_non_prefixed_coreutils
- gnubin = "#{Formulary.factory("coreutils").prefix}/libexec/gnubin"
- if paths.include? gnubin then <<-EOS.undent
+ coreutils = Formula["coreutils"]
+ return unless coreutils.an... | false |
Other | Homebrew | brew | c25e11563c839f2d4c49cb28d3bcbff177cc3fb3.json | tests: fix a file leak | Library/Homebrew/test/test_integration_cmds.rb | @@ -158,6 +158,8 @@ def test_uninstall
def test_cleanup
(HOMEBREW_CACHE/"test").write "test"
assert_match "#{HOMEBREW_CACHE}/test", cmd("cleanup", "--prune=all")
+ ensure
+ (HOMEBREW_CACHE/"test").rmtree
end
def test_readall | false |
Other | Homebrew | brew | 77975168e0f2d5e6627d049d6055bc159e3fd89d.json | bin/brew: add support for developer bash commands
This also means `bin/brew` is again consistent with `brew command` and
`brew commands`. | bin/brew | @@ -135,7 +135,11 @@ then
fi
HOMEBREW_COMMAND="$1"
-HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$1.sh"
+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... | false |
Other | Homebrew | brew | 6106ac903550ee323eb08a8abac02ce7c74c4a4d.json | update-bash: discourage direct use
Remove the executable bit from the file to make it clear it is not
supposed to be executed directly. This should make the shebang line and
the early check also unnecessary. | Library/Homebrew/cmd/update-bash.sh | @@ -1,12 +1,3 @@
-#!/bin/bash
-
-if [[ -z "$HOMEBREW_BREW_FILE" ]]
-then
- # we don't use odie here, because it's only available when this script is called from brew.
- echo "Error: $(basename "$0") must be called from brew!" >&2
- exit 1
-fi
-
brew() {
"$HOMEBREW_BREW_FILE" "$@"
} | false |
Other | Homebrew | brew | a59c1ae6cb90644869862e6432ed8e82ac361ebe.json | os/mac: hide GCC warnings in `config` output. | Library/Homebrew/os/mac.rb | @@ -132,7 +132,7 @@ def default_compiler
def gcc_40_build_version
@gcc_40_build_version ||=
if (path = locate("gcc-4.0"))
- `#{path} --version`[/build (\d{4,})/, 1].to_i
+ `#{path} --version 2>/dev/null`[/build (\d{4,})/, 1].to_i
end
end
alias_method :gcc_4_0_bu... | false |
Other | Homebrew | brew | e1875b7a43f233252d795a4e10ee4125658466e8.json | audit: avoid false positive pkgshare problems | Library/Homebrew/cmd/audit.rb | @@ -878,11 +878,11 @@ def audit_line(line, lineno)
problem "`#{$1}` is now unnecessary"
end
- if line =~ /#\{share\}\/#{formula.name}/
+ if line =~ %r{#\{share\}/#{formula.name}[/'"]}
problem "Use \#{pkgshare} instead of \#{share}/#{formula.name}"
end
- if line =~ /sha... | false |
Other | Homebrew | brew | 3d9bc57feacf32d9050569b3645c29d2a0ddd749.json | doc: Fix some typos at Formula Cookbook
Closes Homebrew/homebrew#48342.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com> | share/doc/homebrew/Formula-Cookbook.md | @@ -70,7 +70,7 @@ 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)
-**We don’t accept formulae without [`homepage`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formu... | false |
Other | Homebrew | brew | ead10917d63fb2385d1a9325e5220ad3e8b81ad4.json | Add directions for subscribing to mailing list
Closes Homebrew/homebrew#48369.
Signed-off-by: Tim D. Smith <git@tim-smith.us> | share/doc/homebrew/README.md | @@ -25,7 +25,7 @@ Read [CONTRIBUTING.md](/CONTRIBUTING.md).
### Community Forums
- [@MacHomebrew](https://twitter.com/MacHomebrew)
-- [homebrew-discuss@googlegroups.com](mailto:homebrew-discuss@googlegroups.com) ([archive](https://groups.google.com/forum/#!forum/homebrew-discuss))
+- [homebrew-discuss@googlegrou... | false |
Other | Homebrew | brew | e3687a5ba21385025eb97522654f56557535ba75.json | update-bash: use array for QUIET_ARGS
Per @UniqMartin's advice, avoid disabling shellcheck rules.
Closes Homebrew/homebrew#48286.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/cmd/update-bash.sh | @@ -103,11 +103,9 @@ read_current_revision() {
git rev-parse -q --verify HEAD
}
-# Don't warn about QUIET_ARGS; they need to be unquoted.
-# shellcheck disable=SC2086
pop_stash() {
[[ -z "$STASHED" ]] && return
- git stash pop $QUIET_ARGS
+ git stash pop "${QUIET_ARGS[@]}"
if [[ -n "$HOMEBREW_VERBOSE" ]]... | false |
Other | Homebrew | brew | eb54a6b5d5b05bfd9cc910a9633c35821c49c98f.json | update-bash: handle option flags like -vd
Per @UniqMartin's advice, the original code will fail to handle flags
like `-vd`, because once a case is handled, no other cases are evaluate. | Library/Homebrew/cmd/update-bash.sh | @@ -243,9 +243,10 @@ update-bash() {
--rebase) HOMEBREW_REBASE=1 ;;
--simulate-from-current-branch) HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1 ;;
--*) ;;
- -*v*) HOMEBREW_VERBOSE=1 ;;
- -*d*) HOMEBREW_DEBUG=1 ;;
- -*) ;;
+ -*)
+ [[ "$i" = *v* ]] && HOMEBREW_VERBOSE=1;
+ ... | false |
Other | Homebrew | brew | f7c276a0bee204af223e68a53af13c90674ea356.json | update-bash: fix revision variable setting
* only set HOMEBREW_UPDATE_BEFORE inside pull instead of fetch.
* fix HOMEBREW_UPDATE_BEFORE/AFTER variable settings. They should be set
to INITIAL_REVISION and CURRENT_REVISION correspondingly.
* avoid unnecessary duplicated shellout.
* remove unused variable. | Library/Homebrew/cmd/update-bash.sh | @@ -176,9 +176,10 @@ pull() {
# "brew update --simulate-from-current-branch"
if [[ -n "$HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH" ]]
then
- INITIAL_REVISION="$(git rev-parse -q --verify "$(upstream_branch)")"
+ INITIAL_REVISION="$(git rev-parse -q --verify "$UPSTREAM_BRANCH")"
CURRENT_REVISION="$(read_... | false |
Other | Homebrew | brew | 2f52ca9dedae8f4e1fb144d54f9377ced3abd585.json | update-bash: kill all of subprocess on interrupt when fetching | Library/Homebrew/cmd/update-bash.sh | @@ -293,6 +293,9 @@ EOS
# this procedure will be removed in the future if it seems unnecessary
rename_taps_dir_if_necessary
+ # kill all of subprocess on interrupt
+ trap '{ pkill -P $$; wait; exit 130; }' SIGINT
+
for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
do
[[ -d "$DIR/.git" ... | false |
Other | Homebrew | brew | fafe8f0f53bf91fc41f016b5c2af41ca712783f7.json | update: implement rename_taps_dir_if_necessary in bash
rename_taps_dir_if_necessary must be performed before actual update.
Otherwise, it will report that `HOMEBREW_UPDAET_BEFORE<REPO_VAR>` is
unset. | Library/Homebrew/cmd/update-bash.sh | @@ -44,6 +44,36 @@ git_init_if_necessary() {
fi
}
+rename_taps_dir_if_necessary() {
+ local tap_dir
+ for tap_dir in "$HOMEBREW_LIBRARY"/Taps/*
+ do
+ [[ -d "$tap_dir/.git" ]] || continue
+ local tap_dir_basename
+ tap_dir_basename="${tap_dir##*/}"
+ if [[ "$tap_dir_basename" = *"-"* ]]
+ then
+... | true |
Other | Homebrew | brew | fafe8f0f53bf91fc41f016b5c2af41ca712783f7.json | update: implement rename_taps_dir_if_necessary in bash
rename_taps_dir_if_necessary must be performed before actual update.
Otherwise, it will report that `HOMEBREW_UPDAET_BEFORE<REPO_VAR>` is
unset. | Library/Homebrew/cmd/update-report.rb | @@ -23,10 +23,6 @@ def update_report
end
report.update(master_updater.report)
- # rename Taps directories
- # this procedure will be removed in the future if it seems unnecessasry
- rename_taps_dir_if_necessary
-
updated_taps = []
Tap.each do |tap|
next unless tap.git?
@@ -106,34 +... | true |
Other | Homebrew | brew | 9cd2658073f642af615f24133db9f02c0df2bb9a.json | update-bash: avoid shellout for stripping prefix | Library/Homebrew/cmd/update-bash.sh | @@ -54,8 +54,8 @@ repo_var() {
upstream_branch() {
local upstream_branch
- upstream_branch="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null |
- sed -e 's|refs/remotes/origin/||' )"
+ upstream_branch="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null)"
+ upstream_branch="${upst... | false |
Other | Homebrew | brew | 83e13733762fdc728980e57a82cd19979d30141d.json | update-bash: use odie and chdir from bin/brew | Library/Homebrew/cmd/update-bash.sh | @@ -2,6 +2,7 @@
if [[ -z "$HOMEBREW_BREW_FILE" ]]
then
+ # we don't use odie here, because it's only available when this script is called from brew.
echo "Error: $(basename "$0") must be called from brew!" >&2
exit 1
fi
@@ -134,8 +135,7 @@ pull() {
export HOMEBREW_UPDATE_AFTER"$TAP_VAR"="$(git rev-pars... | false |
Other | Homebrew | brew | bb5cf70a02e14480408908c998add40193b6bcf9.json | update-bash: fix incorrect argument parsing | Library/Homebrew/cmd/update-bash.sh | @@ -198,7 +198,7 @@ update-bash() {
--simulate-from-current-branch) HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1 ;;
--*) ;;
-*v*) HOMEBREW_VERBOSE=1 ;;
- -*v*) HOMEBREW_DEBUG=1 ;;
+ -*d*) HOMEBREW_DEBUG=1 ;;
-*) ;;
*)
echo "This command updates brew itself, and does not ... | false |
Other | Homebrew | brew | 274640c97a44756f1b4f32cf0adfd540cbce8b1a.json | tests: use unique identifiers w/ integration tests
Commands executed during integration testing are executed in a separate
process and thus generate a new result set for each command. To avoid
that these results override each other, they need to have a unique
`command_name`. Derive this name from the test class/name a... | Library/Homebrew/test/.simplecov | @@ -13,8 +13,8 @@ SimpleCov.start do
add_filter "Homebrew/vendor/"
end
-if name = ENV["HOMEBREW_INTEGRATION_TEST"]
- SimpleCov.command_name "brew #{name}"
+if ENV["HOMEBREW_INTEGRATION_TEST"]
+ SimpleCov.command_name ENV["HOMEBREW_INTEGRATION_TEST"]
SimpleCov.at_exit do
exit_code = $!.nil? ? 0 : $!.stat... | true |
Other | Homebrew | brew | 274640c97a44756f1b4f32cf0adfd540cbce8b1a.json | tests: use unique identifiers w/ integration tests
Commands executed during integration testing are executed in a separate
process and thus generate a new result set for each command. To avoid
that these results override each other, they need to have a unique
`command_name`. Derive this name from the test class/name a... | Library/Homebrew/test/test_integration_cmds.rb | @@ -4,6 +4,16 @@
require "fileutils"
class IntegrationCommandTests < Homebrew::TestCase
+ def setup
+ @cmd_id_index = 0 # Assign unique IDs to invocations of `cmd_output`.
+ end
+
+ def cmd_id_from_args(args)
+ args_pretty = args.join(" ").gsub(TEST_TMPDIR, "@TMPDIR@")
+ test_pretty = "#{self.class.name... | true |
Other | Homebrew | brew | a12c5816aa9d80755f65a4fe53e7d55888a914ac.json | tests: remove useless filter for coverage tests
The filter for `vendor/bundle/` is useless because this directory is
located in `Homebrew/test/` and that one is already filtered. Moreover,
SimpleCov already loads the `bundler_filter` profile (that installs
basically the same filter) in its default configuration. | Library/Homebrew/test/.simplecov | @@ -7,7 +7,6 @@ SimpleCov.start do
coverage_dir File.expand_path("#{tests_path}/coverage")
root File.expand_path("#{tests_path}/../../")
- add_filter "vendor/bundle/"
add_filter "Formula/"
add_filter "Homebrew/compat/"
add_filter "Homebrew/test/" | false |
Other | Homebrew | brew | 37e61aed6266e57c55708774743f5ae802bd0aeb.json | build#install: install metafiles in buildpath
This came up in https://github.com/Homebrew/homebrew-emacs/pull/158#issuecomment-172031003; `install_metafiles` is passed the current directory, which can be changed during installation by `Dir.chdir`.
There may be cases where the metafiles are in a subdirectory, but my
... | Library/Homebrew/build.rb | @@ -133,7 +133,7 @@ def install
Tab.create(formula, ENV.compiler, stdlibs.first, formula.build, formula.source_modified_time).write
# Find and link metafiles
- formula.prefix.install_metafiles Pathname.pwd
+ formula.prefix.install_metafiles formula.buildpath
formula.prefix.ins... | false |
Other | Homebrew | brew | 2d65caaee9ed1f7a9991451cc71eabe8f7c494cc.json | bin/brew: use not operator inside `[[` | bin/brew | @@ -122,7 +122,7 @@ fi
# Many Pathname operations use getwd when they shouldn't, and then throw
# odd exceptions. Reduce our support burden by showing a user-friendly error.
-if ! [[ -d "$(pwd)" ]]
+if [[ ! -d "$(pwd)" ]]
then
odie "The current working directory doesn't exist, cannot proceed."
fi | false |
Other | Homebrew | brew | 318ce388d75bb87cf2ee9966bfc19f0346460998.json | bin/brew: use full path for xcode-select
Closes Homebrew/homebrew#48197.
Signed-off-by: Xu Cheng <xucheng@me.com> | bin/brew | @@ -96,7 +96,7 @@ export HOMEBREW_CELLAR
if [[ -n "$HOMEBREW_OSX" ]]
then
- if [[ "$('xcode-select' --print-path)" = "/" ]]
+ if [[ "$('/usr/bin/xcode-select' --print-path)" = "/" ]]
then
odie <<EOS
Your xcode-select path is currently set to '/'. | false |
Other | Homebrew | brew | f51587ee7474a6582d9a44ae54f2a7937b046125.json | brew.rb: fix style problem
Generated by `brew style --fix Library/brew.rb` | Library/brew.rb | @@ -82,7 +82,7 @@ def require?(path)
end
if internal_cmd
- Homebrew.send cmd.to_s.gsub("-", "_").downcase
+ Homebrew.send cmd.to_s.tr("-", "_").downcase
elsif which "brew-#{cmd}"
%w[CACHE CELLAR LIBRARY_PATH PREFIX REPOSITORY].each do |e|
ENV["HOMEBREW_#{e}"] = Object.const_get("HOMEBREW_#{... | false |
Other | Homebrew | brew | b324d61f35f9eaee3825817ede071e5e592939e6.json | bin/brew: remove unpin from sudo check list
We only need to check sudo for commands which create files. | bin/brew | @@ -140,7 +140,7 @@ HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$1.sh"
if [[ "$(id -u)" = "0" && "$(stat -f%u "$HOMEBREW_BREW_FILE")" != "0" ]]
then
case "$HOMEBREW_COMMAND" in
- instal|install|reinstall|postinstall|ln|link|pin|unpin|update|update-bash|upgrade|create|migrate|tap|switch)
+ instal|in... | false |
Other | Homebrew | brew | e12e1a5d5d71a250d66e3070f0047dd10278eb38.json | bin/brew: introduce odie function | bin/brew | @@ -1,10 +1,23 @@
#!/bin/bash
+odie() {
+ if [[ -t 2 ]] # check whether stderr is a tty.
+ then
+ echo -ne "\033[4;31mError\033[0m: " >&2 # highlight Error with underline and red color
+ else
+ echo -n "Error: " >&2
+ fi
+ if [[ $# -eq 0 ]]
+ then
+ /bin/cat >&2
+ else
+ echo "$*" >&2
+ fi
+ exi... | false |
Other | Homebrew | brew | 29c50d256741fc54a99aec1f6b9513ecb32ef8f7.json | bin/brew: remove unnecessary check
HOMEBREW_BASH_COMMAND variable will always exist. So we only need to
check whether the corresponding file exist or not. | bin/brew | @@ -143,7 +143,7 @@ EOS
esac
fi
-if [ -n "$HOMEBREW_BASH_COMMAND" ] && [ -x "$HOMEBREW_BASH_COMMAND" ]
+if [ -x "$HOMEBREW_BASH_COMMAND" ]
then
# source rather than executing directly to ensure the entire file is read into
# memory before it is run. This makes running a Bash script behave more like | false |
Other | Homebrew | brew | f9b33e26e077a80e85caa1b2434943ab7b55de60.json | brew: remove duplicated logic
This is now handled by `bin/brew` | Library/brew.rb | @@ -12,9 +12,6 @@
if ARGV == %w[--version] || ARGV == %w[-v]
puts "Homebrew #{Homebrew.homebrew_version_string}"
exit 0
-elsif ARGV.first == "-v"
- # Shift the -v to the end of the parameter list
- ARGV << ARGV.shift
end
if OS.mac? && MacOS.version < "10.6" | false |
Other | Homebrew | brew | 92a71a534f9aa956eecc7ebeac0bd5dbe0ca980f.json | os/mac: use start_with? when possible
Closes Homebrew/homebrew#48071.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/os/mac.rb | @@ -141,7 +141,7 @@ def gcc_42_build_version
@gcc_42_build_version ||=
begin
gcc = MacOS.locate("gcc-4.2") || HOMEBREW_PREFIX.join("opt/apple-gcc42/bin/gcc-4.2")
- if gcc.exist? && gcc.realpath.basename.to_s !~ /^llvm/
+ if gcc.exist? && !gcc.realpath.basename.to_s.start_wit... | true |
Other | Homebrew | brew | 92a71a534f9aa956eecc7ebeac0bd5dbe0ca980f.json | os/mac: use start_with? when possible
Closes Homebrew/homebrew#48071.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/os/mac/xcode.rb | @@ -141,9 +141,9 @@ def provides_cvs?
def default_prefix?
if version < "4.3"
- %r{^/Developer} === prefix
+ prefix.to_s.start_with? "/Developer"
else
- %r{^/Applications/Xcode.app} === prefix
+ prefix.to_s.start_with? "/Applications/Xcode.app"
end
... | true |
Other | Homebrew | brew | 89c63279d43e3103ded9c0cd4c2fcb271435ca5f.json | Remove cleanup --force from bash completion | Library/Contributions/brew_bash_completion.sh | @@ -162,13 +162,6 @@ _brew_bottle ()
_brew_cleanup ()
{
- local cur="${COMP_WORDS[COMP_CWORD]}"
- case "$cur" in
- --*)
- __brewcomp "--force"
- return
- ;;
- esac
__brew_complete_installed
}
| false |
Other | Homebrew | brew | b118539c8c17147e76eed7a0caf44e537f170f43.json | bin/brew: use a function to avoid issues.
Otherwise when `bin/brew` is updated in-place Bash will carry on from
the offset and this can cause issues.
Thanks to `@UniqMartin` for pointing this out. | bin/brew | @@ -156,8 +156,7 @@ then
# Hide shellcheck complaint:
# shellcheck source=/dev/null
source "$HOMEBREW_BASH_COMMAND"
- "$HOMEBREW_COMMAND" "$@"
- exit $?
+ { "$HOMEBREW_COMMAND" "$@"; exit $?; }
else
exec "$HOMEBREW_RUBY_PATH" -W0 "$HOMEBREW_LIBRARY/brew.rb" "$@"
fi | false |
Other | Homebrew | brew | 42681b51f83193f0fb9c178c85e2d1b17926ebd2.json | formula_installer: build formula options better.
Previously we got all the options based on the build, any inherited
options, any passed options and the tab. We want to make sure that these
then exclude any options that don't exist as, otherwise, passing an
option that doesn't exist (or has been deleted) is enough to ... | Library/Homebrew/formula_installer.rb | @@ -353,6 +353,7 @@ def effective_build_options_for(dependent, inherited_options = [])
args = dependent.build.used_options
args |= dependent == formula ? options : inherited_options
args |= Tab.for_formula(dependent).used_options
+ args &= dependent.options
BuildOptions.new(args, dependent.optio... | false |
Other | Homebrew | brew | 6f91b429ceee780088b659e519e19262bcfd48cf.json | Move some brew.rb logic to bin/brew. | Library/brew.rb | @@ -4,11 +4,6 @@
HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"]
-if ARGV == %w[--prefix]
- puts File.dirname(File.dirname(HOMEBREW_BREW_FILE))
- exit 0
-end
-
require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent.join("Homebrew")
$:.unshift(HOMEBREW_LIBRARY_PATH.to_s)
@@ -22,49 +17... | true |
Other | Homebrew | brew | 6f91b429ceee780088b659e519e19262bcfd48cf.json | Move some brew.rb logic to bin/brew. | bin/brew | @@ -37,6 +37,19 @@ else
HOMEBREW_CELLAR="$HOMEBREW_REPOSITORY/Cellar"
fi
+case "$*" in
+ --prefix) echo "$HOMEBREW_PREFIX"; exit 0 ;;
+ --cellar) echo "$HOMEBREW_CELLAR"; exit 0 ;;
+ --repository|--repo) echo "$HOMEBREW_REPOSITORY"; exit 0 ;;
+esac
+
+if [ "$HOMEBREW_PREFIX" = "/" ] || [ "$HOMEBREW_PREFIX" = "... | true |
Other | Homebrew | brew | effca7d9c60495f7c5c21af637da4e0e2952f66e.json | bin/brew: set more HOMEBREW_* env from Bash. | Library/Homebrew/config.rb | @@ -31,21 +31,16 @@ def mkpath
end
# Where we link under
-HOMEBREW_PREFIX = Pathname.new(HOMEBREW_BREW_FILE).dirname.parent
+HOMEBREW_PREFIX = Pathname.new(ENV["HOMEBREW_PREFIX"])
# Where .git is found
-HOMEBREW_REPOSITORY = Pathname.new(HOMEBREW_BREW_FILE).realpath.dirname.parent
+HOMEBREW_REPOSITORY = Pathname... | true |
Other | Homebrew | brew | effca7d9c60495f7c5c21af637da4e0e2952f66e.json | bin/brew: set more HOMEBREW_* env from Bash. | bin/brew | @@ -21,7 +21,18 @@ then
chdir "$BREW_SYMLINK_DIRECTORY" && pwd -P)"
fi
-BREW_LIBRARY_DIRECTORY="$(chdir "$BREW_FILE_DIRECTORY"/../Library && pwd -P)"
+HOMEBREW_PREFIX="$(chdir "$(dirname "$(dirname "$HOMEBREW_BREW_FILE")")" && pwd -P)"
+HOMEBREW_REPOSITORY="$(chdir "$BREW_FILE_DIRECTORY"/..... | true |
Other | Homebrew | brew | f92fc98ec03fd6b5176f65dd0d0d855925dcf59b.json | test-bot: change directory for git rev-parse --verify | Library/Homebrew/cmd/test-bot.rb | @@ -213,7 +213,7 @@ def initialize(argument, options={})
@repository = @tap.path
@skip_homebrew = options.fetch(:skip_homebrew, false)
- if quiet_system "git", "rev-parse", "--verify", "-q", argument
+ if quiet_system "git", "-C", @repository.to_s, "rev-parse", "--verify", "-q", argument
... | false |
Other | Homebrew | brew | d4c7dedf1246e31daca2aa9be22f8f6e4a6c528f.json | audit: imporve revision check logic
* Check revision decrease against both stable and devel spec.
* Check revision reset only for stable spec if stable spec is available. | Library/Homebrew/cmd/audit.rb | @@ -588,8 +588,14 @@ def audit_revision
revision_map = fv.revision_map("origin/master")
if (revisions = revision_map[formula.version]).any?
problem "revision should not decrease" if formula.revision < revisions.max
- else
- problem "revision should be removed" unless formula.revision == 0
+ ... | false |
Other | Homebrew | brew | b73a6f195af2a29c618f453f55db98329010f385.json | test-bot: remove dead code | Library/Homebrew/cmd/test-bot.rb | @@ -287,12 +287,6 @@ def diff_formulae(start_revision, end_revision, path, filter)
end.compact
end
- def brew_update
- return unless current_branch == "master"
- success = quiet_system "brew", "update"
- success ||= quiet_system "brew", "update"
- end
-
@category ... | false |
Other | Homebrew | brew | 4a8632e54d02b8c71ab581f18287a682e1640bcc.json | unpack: preserve file attributes like mtime
Closes Homebrew/homebrew#48068.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/cmd/unpack.rb | @@ -28,7 +28,7 @@ def unpack
ENV["VERBOSE"] = "1" # show messages about tar
f.brew do
f.patch if ARGV.flag?("--patch")
- cp_r getwd, stage_dir
+ cp_r getwd, stage_dir, :preserve => true
end
ENV["VERBOSE"] = nil
| false |
Other | Homebrew | brew | 8deec537d15d35821be4e8e253ad2a877535cbc8.json | test_download_strategies: add mtime test | Library/Homebrew/test/resources/source-with-broken-symlink/broken-link | @@ -1 +0,0 @@
-does-not-exist
\ No newline at end of file | true |
Other | Homebrew | brew | 8deec537d15d35821be4e8e253ad2a877535cbc8.json | test_download_strategies: add mtime test | Library/Homebrew/test/test_bottle.rb | @@ -1,8 +0,0 @@
-require "testing_env"
-require "cmd/bottle"
-
-class BottleTests < Homebrew::TestCase
- def test_most_recent_mtime_with_broken_symlink()
- refute_nil Homebrew.most_recent_mtime(Pathname(File.join(TEST_DIRECTORY, 'resources/source-with-broken-symlink')))
- end
-end | true |
Other | Homebrew | brew | 8deec537d15d35821be4e8e253ad2a877535cbc8.json | test_download_strategies: add mtime test | Library/Homebrew/test/test_download_strategies.rb | @@ -11,6 +11,8 @@ def initialize(url = "http://example.com/foo.tar.gz", specs = {})
end
class AbstractDownloadStrategyTests < Homebrew::TestCase
+ include FileUtils
+
def setup
@name = "foo"
@resource = ResourceDouble.new
@@ -34,6 +36,15 @@ def test_expand_safe_system_args_does_not_mutate_argument
... | true |
Other | Homebrew | brew | 7958343f1694a72c8f15b7bf0e00a888fa321996.json | bottle: read source modified time from tabfile
* Avoid unnecessary stage overhead
* Support different download strategy, e.g. `git`. | Library/Homebrew/cmd/bottle.rb | @@ -140,10 +140,6 @@ def bottle_output(bottle)
erb.result(bottle.instance_eval { binding }).gsub(/^\s*$\n/, "")
end
- def most_recent_mtime(pathname)
- pathname.to_enum(:find).select(&:exist?).map(&:mtime).max
- end
-
def bottle_formula(f)
unless f.installed?
return ofail "Formula not inst... | false |
Other | Homebrew | brew | fab16b83e94cb38d9f90834c87b7f1604f19f14e.json | tab: add source modified time metadata | Library/Homebrew/tab.rb | @@ -15,14 +15,15 @@ def self.clear_cache
CACHE.clear
end
- def self.create(formula, compiler, stdlib, build)
+ def self.create(formula, compiler, stdlib, build, source_modified_time)
attributes = {
"used_options" => build.used_options.as_flags,
"unused_options" => build.unused_options.as_... | true |
Other | Homebrew | brew | fab16b83e94cb38d9f90834c87b7f1604f19f14e.json | tab: add source modified time metadata | Library/Homebrew/test/test_tab.rb | @@ -7,15 +7,16 @@ def setup
@used = Options.create(%w[--with-foo --without-bar])
@unused = Options.create(%w[--with-baz --without-qux])
- @tab = Tab.new("used_options" => @used.as_flags,
- "unused_options" => @unused.as_flags,
- "built_as_bottle" => false,... | true |
Other | Homebrew | brew | 31da9b266a5eab3bc349d62e7f5cd7cb67741375.json | audit: enforce revision check
Add two checks:
* revision should be reset to 0 for new version.
* revision should not decrease inside the same version interval.
Closes Homebrew/homebrew#48032.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/cmd/audit.rb | @@ -1,4 +1,5 @@
require "formula"
+require "formula_versions"
require "utils"
require "extend/ENV"
require "formula_cellar_checks"
@@ -579,6 +580,19 @@ def audit_specs
end
end
+ def audit_revision
+ return unless formula.tap # skip formula not from core or any taps
+ return unless formula.tap.git? ... | true |
Other | Homebrew | brew | 31da9b266a5eab3bc349d62e7f5cd7cb67741375.json | audit: enforce revision check
Add two checks:
* revision should be reset to 0 for new version.
* revision should not decrease inside the same version interval.
Closes Homebrew/homebrew#48032.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/formula_versions.rb | @@ -54,4 +54,14 @@ def bottle_version_map(branch)
end
map
end
+
+ def revision_map(branch)
+ map = Hash.new { |h, k| h[k] = [] }
+ rev_list(branch) do |rev|
+ formula_at_revision(rev) do |f|
+ map[f.version] << f.revision
+ end
+ end
+ map
+ end
end | true |
Other | Homebrew | brew | 159373707b4d8da7f27dbae92585b11674cbd8a2.json | Cookbook: remove ref to obsolete 'def patches' | share/doc/homebrew/Formula-Cookbook.md | @@ -769,7 +769,7 @@ Check if the formula you are updating is a dependency for any other formulae by
Homebrew wants to maintain a consistent Ruby style across all formulae based on [Ruby Style Guide](https://github.com/styleguide/ruby). Other formulae may not have been updated to match this guide yet but all new ones... | false |
Other | Homebrew | brew | 07e849e7f4b3dd7cc3e5cb19f0a6d4d1247b63c9.json | Fix built_as_bottle in Formula's to_hash
This was caused by a "race" between two commits.
bash-3.2$ git log -n1 --format=%ai 3344229
2012-08-15 22:08:40 -0500
bash-3.2$ git log -n1 --format=%ci 3344229
2012-09-17 20:01:37 -0500
bash-3.2$ git log -n1 --format=%ai 8837423
2012-08-25 11:31:57 -0700
bash-3.2$ git log -n1 ... | Library/Homebrew/formula.rb | @@ -1287,7 +1287,7 @@ def to_hash
hsh["installed"] << {
"version" => keg.version.to_s,
"used_options" => tab.used_options.as_flags,
- "built_as_bottle" => tab.built_bottle,
+ "built_as_bottle" => tab.built_as_bottle,
"poured_from_bottle" => tab.poured_from_bottle
}... | false |
Other | Homebrew | brew | 9810c2a412526346797f2f1ef60ddbccddeca2cb.json | test_tap: restore private remote test
Only test it if HOMEBREW_GITHUB_API_TOKEN is set. | Library/Homebrew/test/test_tap.rb | @@ -5,7 +5,6 @@ def setup
@path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
@path.mkpath
@tap = Tap.new("Homebrew", "foo")
- @tap.stubs(:private?).returns(true) if ENV["HOMEBREW_NO_GITHUB_API"]
end
def setup_tap_files
@@ -116,6 +115,11 @@ def test_remote
refute_predicate version_tap, :pr... | false |
Other | Homebrew | brew | 86cc780ea252881cdda4541c3c251af7995224b0.json | test_tap: remove problematic test
`Tap#private?` requires Github API, which can cause problem on Travis CI
due to API rate limit. | Library/Homebrew/test/test_tap.rb | @@ -104,7 +104,6 @@ def test_remote
assert_equal "https://github.com/Homebrew/homebrew-foo", @tap.remote
assert_raises(TapUnavailableError) { Tap.new("Homebrew", "bar").remote }
refute_predicate @tap, :custom_remote?
- assert_predicate @tap, :private?
version_tap = Tap.new("Homebrew", "versions... | false |
Other | Homebrew | brew | f239a448b2750a2f4df5cf7dd7a0df918b130f17.json | Cookbook: Replace 'onoe' with 'odie'
Closes Homebrew/homebrew#47948.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | share/doc/homebrew/Formula-Cookbook.md | @@ -338,7 +338,7 @@ Three commands are provided for displaying informational messages to the user:
* `opoo` for warning messages
* `odie` for error messages and immediately exiting
-In particular, when a test needs to be performed before installation use `onoe` to bail out gracefully. For example:
+In particula... | false |
Other | Homebrew | brew | bcedfe64e8ca64e092ca72c3f61fe164c28c8af5.json | doctor: simplify handling of slow checks
Some (rather slow) checks should run after all other checks. Make that
more obvious by removing them from the sorted list of all checks and
then re-appending them to the resulting list. (Should be slightly more
efficient than the `<array>.reverse.uniq.reverse` incantation, thou... | Library/Homebrew/cmd/doctor.rb | @@ -12,9 +12,13 @@ def doctor
checks.inject_dump_stats! if ARGV.switch? "D"
if ARGV.named.empty?
- methods = checks.all.sort
- methods << "check_for_linked_keg_only_brews" << "check_for_outdated_homebrew"
- methods = methods.reverse.uniq.reverse
+ slow_checks = %w[
+ check_for_bro... | false |
Other | Homebrew | brew | 1b4cc77e14401480111cbd5a53e38bead641d8d8.json | requirements: add rbenv requirement | Library/Homebrew/requirements.rb | @@ -66,6 +66,13 @@ class PostgresqlRequirement < Requirement
satisfy { which "pg_config" }
end
+class RbenvRequirement < Requirement
+ fatal true
+ default_formula "rbenv"
+
+ satisfy { which "rbenv" }
+end
+
class GPGRequirement < Requirement
fatal true
default_formula "gpg"
@@ -124,4 +131,3 @@ class G... | false |
Other | Homebrew | brew | 7076ed890a1eee10c94791e7557ab16769ab80ef.json | os/mac: add outdated_release? method.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/os/mac.rb | @@ -28,6 +28,11 @@ def prerelease?
version >= "10.12"
end
+ def outdated_release?
+ # TODO: bump version when new OS is released
+ version < "10.9"
+ end
+
def cat
version.to_sym
end | false |
Other | Homebrew | brew | 6826cd68da17560e8440b880c05741a5820358a6.json | formula_installer: improve empty installation detection
Use FormulaAuditor.audit_prefix_has_contents from audit.rb, which has
better logic.
Closes Homebrew/homebrew#47678.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/formula_installer.rb | @@ -8,6 +8,7 @@
require "cleaner"
require "formula_cellar_checks"
require "install_renamed"
+require "cmd/audit"
require "cmd/postinstall"
require "hooks/bottles"
require "debrew"
@@ -572,7 +573,11 @@ def build
end
end
- raise "Empty installation" if Dir["#{formula.prefix}/*"].empty?
+ auditor... | false |
Other | Homebrew | brew | 91d4ba7158f3d8fc32b2a668cd1153a0d6971087.json | update: abbreviate hashes to at least 7 characters
Abbreviations will be longer if needed to preserve uniqueness.
This makes it more consistent with `git rev-parse --short`,
https://github.com/Homebrew/homebrew/commits, etc.
For example, instead of:
Updated Homebrew from 40d1e9c2 to 90b9bdf4.
We see:
Upda... | Library/Homebrew/cmd/update.rb | @@ -41,8 +41,9 @@ def update
master_updater.pull!
master_updated = master_updater.updated?
if master_updated
- puts "Updated Homebrew from #{master_updater.initial_revision[0, 8]} " \
- "to #{master_updater.current_revision[0, 8]}."
+ initial_short = shorten_revision(master_updater.in... | false |
Other | Homebrew | brew | 319ea4273e61944b41f033194496cdf6df9fe288.json | list: exclude Ruby from unbrewed
Those are created by the `ruby` formula in core and various Ruby
formulae from `homebrew/versions` and contain Gems and other stuff that
is to be retained across updates. Treat it like Python in this regard.
This avoids spurious output in `brew list --unbrewed` when a brewed
`ruby` is... | Library/Homebrew/cmd/list.rb | @@ -49,6 +49,9 @@ def list
lib/python[23].[0-9]/*
lib/pypy/*
lib/pypy3/*
+ lib/ruby/gems/[12].*
+ lib/ruby/site_ruby/[12].*
+ lib/ruby/vendor_ruby/[12].*
share/pypy/*
share/pypy3/*
share/doc/homebrew/* | false |
Other | Homebrew | brew | d6c6f003935dc3d41e794cdcd17642604b295544.json | Common-Issues: add section for upgrading OS X.
Closes Homebrew/homebrew#47008.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | share/doc/homebrew/Common-Issues.md | @@ -160,3 +160,17 @@ To list all files that would be deleted:
Don't follow the advice here but fix by using
`Language::Python.setup_install_args` in the formula as described in
[Python for Formula Authors](Python-for-Formula-Authors.md).
+
+### Upgrading OS X
+
+Upgrading OS X can cause errors like the following:
+
... | false |
Other | Homebrew | brew | 8161595015736d52fcdf4017037155734326e57b.json | manpage: add parentheses in 'search' synopsis
For consistency with other commands where there is a list of mutually
exclusive options of which exactly one has to be specified. | Library/Homebrew/manpages/brew.1.md | @@ -365,7 +365,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
surrounded with slashes, then it is interpreted as a regular expression.
The search for <text> is extended online to some popular taps.
- * `search` `--debian`|`--fedora`|`--fink`|`--macports`|`--opensuse`|`... | true |
Other | Homebrew | brew | 8161595015736d52fcdf4017037155734326e57b.json | manpage: add parentheses in 'search' synopsis
For consistency with other commands where there is a list of mutually
exclusive options of which exactly one has to be specified. | share/doc/homebrew/brew.1.html | @@ -283,7 +283,7 @@ <h2 id="COMMANDS">COMMANDS</h2>
<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
surrounded with slashes, then it is interpreted as a regular expres... | true |
Other | Homebrew | brew | 8161595015736d52fcdf4017037155734326e57b.json | manpage: add parentheses in 'search' synopsis
For consistency with other commands where there is a list of mutually
exclusive options of which exactly one has to be specified. | share/man/man1/brew.1 | @@ -390,7 +390,7 @@ Display all locally available formulae for brewing (including tapped ones)\. No
Perform a substring search of formula names for \fItext\fR\. If \fItext\fR is surrounded with slashes, then it is interpreted as a regular expression\. The search for \fItext\fR is extended online to some popular taps\.... | true |
Other | Homebrew | brew | b3627cc5b2893f33984b9fee9648c415ff350b5c.json | manpage: fix minor formatting inconsistencies | Library/Homebrew/manpages/brew.1.md | @@ -190,7 +190,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
To view formula history locally: `brew log -p <formula>`.
- * `info --json=`<version> (`--all`|`--installed`|<formulae>):
+ * `info` `--json=`<version> (`--all`|`--installed`|<formulae>):
Print a JSON rep... | true |
Other | Homebrew | brew | b3627cc5b2893f33984b9fee9648c415ff350b5c.json | manpage: fix minor formatting inconsistencies | share/doc/homebrew/brew.1.html | @@ -150,7 +150,7 @@ <h2 id="COMMANDS">COMMANDS</h2>
<dt><code>info</code> <code>--github</code> <var>formula</var></dt><dd><p>Open a browser to the GitHub History page for formula <var>formula</var>.</p>
<p>To view formula history locally: <code>brew log -p <formula></code>.</p></dd>
-<dt><code>info --json=</cod... | true |
Other | Homebrew | brew | b3627cc5b2893f33984b9fee9648c415ff350b5c.json | manpage: fix minor formatting inconsistencies | share/man/man1/brew.1 | @@ -207,7 +207,7 @@ Open a browser to the GitHub History page for formula \fIformula\fR\.
To view formula history locally: \fBbrew log \-p <formula>\fR\.
.
.TP
-\fBinfo \-\-json=\fR\fIversion\fR (\fB\-\-all\fR|\fB\-\-installed\fR|\fIformulae\fR)
+\fBinfo\fR \fB\-\-json=\fR\fIversion\fR (\fB\-\-all\fR|\fB\-\-installe... | true |
Other | Homebrew | brew | aaefcb02b6649551d8a86a5f0237041c14113dfb.json | manpage: improve synopsis for 'options' command
The options `--all`, `--installed`, and a list of formulae are mutually
exclusive arguments, of which exactly one is required. | Library/Homebrew/manpages/brew.1.md | @@ -315,8 +315,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--force` is passed, then treat installed <formulae> and passed <formulae>
like if they are from same taps and migrate them anyway.
- * `options` [`--compact`] [`--all`] [`--installed`] <formula>:
- Di... | true |
Other | Homebrew | brew | aaefcb02b6649551d8a86a5f0237041c14113dfb.json | manpage: improve synopsis for 'options' command
The options `--all`, `--installed`, and a list of formulae are mutually
exclusive arguments, of which exactly one is required. | share/doc/homebrew/brew.1.html | @@ -249,7 +249,7 @@ <h2 id="COMMANDS">COMMANDS</h2>
<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>options</code> [<code>--compact</code>] [<code>--all</code>] [<code>--install... | true |
Other | Homebrew | brew | aaefcb02b6649551d8a86a5f0237041c14113dfb.json | manpage: improve synopsis for 'options' command
The options `--all`, `--installed`, and a list of formulae are mutually
exclusive arguments, of which exactly one is required. | share/man/man1/brew.1 | @@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "BREW" "1" "December 2015" "Homebrew" "brew"
+.TH "BREW" "1" "January 2016" "Homebrew" "brew"
.
.SH "NAME"
\fBbrew\fR \- The missing package manager for OS X
@@ -334,8 +334,8 @@ Migrate renamed packages to new nam... | true |
Other | Homebrew | brew | a508f9f94b55089d2e37e4f0b0869bd0e425d40c.json | Revert "formula: pass sdk_path in std_cmake_args"
This reverts commit 5896555e5352b5e4f16f583ea444942cd1fc56bd.
It caused header-location issue on dual-developer-tool systems for certain
formulae. Will need looking at again, but we'll probably have to try and
do this a different way.
Closes Homebrew/homebrew#47668. | Library/Homebrew/formula.rb | @@ -1047,7 +1047,6 @@ def std_cmake_args
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON
- -DCMAKE_OSX_SYSROOT=#{MacOS.sdk_path}
-Wno-dev
]
end | false |
Other | Homebrew | brew | 0472b3f34048b7396631d33d4e1cda506ce1a5b1.json | doctor: use respond_to? instead of NoMethodError
Closes Homebrew/homebrew#47715.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/cmd/doctor.rb | @@ -21,13 +21,13 @@ def doctor
first_warning = true
methods.each do |method|
- begin
- out = checks.send(method)
- rescue NoMethodError
+ unless checks.respond_to?(method)
Homebrew.failed = true
puts "No check available by the name: #{method}"
next
end... | false |
Other | Homebrew | brew | 9f1442db14f8791c6563a701a094b4fc0c2c9b56.json | doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/cmd/doctor.rb | @@ -1,1318 +1,15 @@
-require "cmd/missing"
-require "formula"
-require "keg"
-require "language/python"
-require "version"
-
-class Volumes
- def initialize
- @volumes = get_mounts
- end
-
- def which(path)
- vols = get_mounts path
-
- # no volume found
- if vols.empty?
- return -1
- end
-
- v... | true |
Other | Homebrew | brew | 9f1442db14f8791c6563a701a094b4fc0c2c9b56.json | doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/cmd/install.rb | @@ -1,5 +1,5 @@
require "blacklist"
-require "cmd/doctor"
+require "diagnostic"
require "cmd/search"
require "formula_installer"
require "tap"
@@ -159,7 +159,7 @@ def check_writable_install_location
end
def check_xcode
- checks = Checks.new
+ checks = Diagnostic::Checks.new
%w[
check_for_u... | true |
Other | Homebrew | brew | 9f1442db14f8791c6563a701a094b4fc0c2c9b56.json | doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/cmd/missing.rb | @@ -1,30 +1,8 @@
require "formula"
require "tab"
+require "diagnostic"
module Homebrew
- def missing_deps(ff)
- missing = {}
- ff.each do |f|
- missing_deps = f.recursive_dependencies do |dependent, dep|
- if dep.optional? || dep.recommended?
- tab = Tab.for_formula(dependent)
- ... | true |
Other | Homebrew | brew | 9f1442db14f8791c6563a701a094b4fc0c2c9b56.json | doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/cmd/update.rb | @@ -1,5 +1,5 @@
require "cmd/tap"
-require "cmd/doctor"
+require "diagnostic"
require "formula_versions"
require "migrator"
require "formulary"
@@ -15,7 +15,7 @@ def update
end
# check permissions
- checks = Checks.new
+ checks = Diagnostic::Checks.new
%w[
check_access_usr_local
... | true |
Other | Homebrew | brew | 9f1442db14f8791c6563a701a094b4fc0c2c9b56.json | doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/diagnostic.rb | @@ -0,0 +1,1344 @@
+require "keg"
+require "language/python"
+require "formula"
+require "version"
+
+module Homebrew
+ module Diagnostic
+ def self.missing_deps(ff)
+ missing = {}
+ ff.each do |f|
+ missing_deps = f.recursive_dependencies do |dependent, dep|
+ if dep.optional? || dep.reco... | true |
Other | Homebrew | brew | 9f1442db14f8791c6563a701a094b4fc0c2c9b56.json | doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/exceptions.rb | @@ -265,8 +265,8 @@ def dump
puts issues.map { |i| "#{i["title"]} #{i["html_url"]}" }.join("\n")
end
- require "cmd/doctor"
- unsupported_osx = Checks.new.check_for_unsupported_osx
+ require "diagnostic"
+ unsupported_osx = Diagnostic::Checks.new.check_for_unsupported_osx
opoo unsupported... | true |
Other | Homebrew | brew | 9f1442db14f8791c6563a701a094b4fc0c2c9b56.json | doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/test/test_integration_cmds.rb | @@ -1,6 +1,7 @@
require "bundler"
require "testing_env"
require "core_formula_repository"
+require "fileutils"
class IntegrationCommandTests < Homebrew::TestCase
def cmd_output(*args)
@@ -152,7 +153,7 @@ class Foo < Formula
cmd("readall", "--aliases", "--syntax")
cmd("readall", "Homebrew/homebrew")
... | true |
Other | Homebrew | brew | 5d8a6e368f2c8fd5d2075cfb9dd8bb3928c2ac42.json | integration tests: allow env overriding | Library/Homebrew/test/test_integration_cmds.rb | @@ -4,6 +4,8 @@
class IntegrationCommandTests < Homebrew::TestCase
def cmd_output(*args)
+ # 1.8-compatible way of writing def cmd_output(*args, **env)
+ env = args.last.is_a?(Hash) ? args.pop : {}
cmd_args = %W[
-W0
-I#{HOMEBREW_LIBRARY_PATH}/test/lib
@@ -16,6 +18,8 @@ def cmd_output(*ar... | false |
Other | Homebrew | brew | d99cfd139424b12f662eecba28acb05994865aa0.json | tap: require string extensions
Fixes Homebrew/homebrew#47684. | Library/Homebrew/tap.rb | @@ -1,3 +1,5 @@
+require "extend/string"
+
# a {Tap} is used to extend the formulae provided by Homebrew core.
# Usually, it's synced with a remote git repository. And it's likely
# a Github repository with the name of `user/homebrew-repo`. In such | false |
Other | Homebrew | brew | dafa11af9a0b346d12fb9e26adb21d8cff0d5a16.json | doctor: add explicit anaconda warning
Closes Homebrew/homebrew#47540.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com> | Library/Homebrew/cmd/doctor.rb | @@ -92,6 +92,31 @@ def check_for_macgpg2
end
end
+ # Anaconda installs multiple system & brew dupes, including OpenSSL, Python,
+ # sqlite, libpng, Qt, etc. Regularly breaks compile on Vim, MacVim and others.
+ # Is flagged as part of the *-config script checks below, but people seem
+ # to ignore those a... | false |
Other | Homebrew | brew | bd4f633673e12793d8ec18a45c352a2d4d1fc382.json | tests: use predefined commit author for robustness
Some tests, that construct a Git repository for testing, will silently
fail if the global Git user isn't properly set up. There are valid use
cases for this, thus use a fixed commit author/committer for all tests
instead of relying on the user's configuration. | Library/Homebrew/cmd/tests.rb | @@ -5,6 +5,13 @@ def tests
ENV["HOMEBREW_TESTS_COVERAGE"] = "1" if ARGV.include? "--coverage"
ENV["HOMEBREW_NO_COMPAT"] = "1" if ARGV.include? "--no-compat"
+ # Override author/committer as global settings might be invalid and thus
+ # will cause silent failure during the setup of dummy Git re... | false |
Other | Homebrew | brew | 47afde940a70f2a3a597f01bf52f1b8ad096e65f.json | formula: fix undefined method error
Fixes: Homebrew/homebrew#47673.
Closes Homebrew/homebrew#47672.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de> | Library/Homebrew/formula.rb | @@ -1495,7 +1495,7 @@ def eligible_kegs_for_cleanup
# If the cellar only has one version installed, don't complain
# that we can't tell which one to keep. Don't complain at all if the
# only installed version is a pinned formula.
- opoo "Skipping #{full_name}: most recent version #{f.pkg_versi... | false |
Other | Homebrew | brew | 8f8c3cc1b195b29551c10fea40889dae92ac3b55.json | integration tests: fix failing test
If the test fails above `formula_file`’s definition this line fails
because `formula_file` is `nil`.
Closes Homebrew/homebrew#47663.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/test/test_integration_cmds.rb | @@ -119,7 +119,7 @@ class Testball < Formula
ensure
cmd("uninstall", "--force", "testball")
cmd("cleanup", "--force", "--prune=all")
- formula_file.unlink
+ formula_file.unlink unless formula_file.nil?
end
def test_uninstall | false |
Other | Homebrew | brew | 9bdd6619e23f498320c3d3a6be8bd8d095a6d521.json | cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/cleanup.rb | @@ -0,0 +1,156 @@
+require "bottles"
+require "formula"
+require "thread"
+
+module Homebrew
+ module Cleanup
+ @@disk_cleanup_size = 0
+
+ def self.cleanup
+ cleanup_cellar
+ cleanup_cache
+ cleanup_logs
+ unless ARGV.dry_run?
+ cleanup_lockfiles
+ rm_DS_Store
+ end
+ e... | true |
Other | Homebrew | brew | 9bdd6619e23f498320c3d3a6be8bd8d095a6d521.json | cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/cmd/cleanup.rb | @@ -1,200 +1,21 @@
-require "formula"
-require "keg"
-require "bottles"
-require "thread"
+require "cleanup"
require "utils"
module Homebrew
- @@disk_cleanup_size = 0
-
- def update_disk_cleanup_size(path_size)
- @@disk_cleanup_size += path_size
- end
-
def cleanup
if ARGV.named.empty?
- cleanup_... | true |
Other | Homebrew | brew | 9bdd6619e23f498320c3d3a6be8bd8d095a6d521.json | cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/cmd/upgrade.rb | @@ -1,5 +1,5 @@
require "cmd/install"
-require "cmd/cleanup"
+require "cleanup"
module Homebrew
def upgrade
@@ -44,7 +44,9 @@ def upgrade
outdated.each do |f|
upgrade_formula(f)
- cleanup_formula(f) if ARGV.include?("--cleanup") && f.installed?
+ next unless ARGV.include?("--cleanup")
+ ... | true |
Other | Homebrew | brew | 9bdd6619e23f498320c3d3a6be8bd8d095a6d521.json | cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/formula.rb | @@ -1475,6 +1475,50 @@ def system(cmd, *args)
end
end
+ # @private
+ def eligible_kegs_for_cleanup
+ eligible_for_cleanup = []
+ if installed?
+ eligible_kegs = installed_kegs.select { |k| pkg_version > k.version }
+ if eligible_kegs.any? && eligible_for_cleanup?
+ eligible_kegs.each ... | true |
Other | Homebrew | brew | 9bdd6619e23f498320c3d3a6be8bd8d095a6d521.json | cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/test/test_cleanup.rb | @@ -0,0 +1,76 @@
+require "testing_env"
+require "testball"
+require "cleanup"
+require "fileutils"
+require "pathname"
+
+class CleanupTests < Homebrew::TestCase
+ def setup
+ @ds_store = Pathname.new "#{HOMEBREW_PREFIX}/Library/.DS_Store"
+ FileUtils.touch @ds_store
+ end
+
+ def teardown
+ FileUtils.rm_f... | true |
Other | Homebrew | brew | 9bdd6619e23f498320c3d3a6be8bd8d095a6d521.json | cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/test/test_cmd_cleanup.rb | @@ -1,30 +0,0 @@
-require "testing_env"
-require "testball"
-require "cmd/cleanup"
-
-class CleanupTests < Homebrew::TestCase
- def test_cleanup
- f1 = Class.new(Testball) { version "0.1" }.new
- f2 = Class.new(Testball) { version "0.2" }.new
- f3 = Class.new(Testball) { version "0.3" }.new
-
- shutup do
-... | true |
Other | Homebrew | brew | 9bdd6619e23f498320c3d3a6be8bd8d095a6d521.json | cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/test/test_formula.rb | @@ -1,5 +1,6 @@
require "testing_env"
require "testball"
+require "formula"
class FormulaTests < Homebrew::TestCase
def test_formula_instantiation
@@ -345,4 +346,25 @@ def test_to_hash_bottle
assert h.is_a?(Hash), "Formula#to_hash should return a Hash"
assert h["versions"]["bottle"], "The hash should ... | true |
Other | Homebrew | brew | 821dbab5f88e9dcbb9f08ba5ef3d8e1bf5dece3b.json | doctor: extend curl warning | Library/Homebrew/cmd/doctor.rb | @@ -677,9 +677,10 @@ def check_user_path_3
end
def check_for_bad_curl
- if MacOS.version <= "10.6" && !Formula["curl"].installed? then <<-EOS.undent
- The system curl on 10.6 and below is often incapable of supporting
+ if MacOS.version <= "10.8" && !Formula["curl"].installed? then <<-EOS.undent
+ ... | false |
Other | Homebrew | brew | c7c9919d3aaba19ea8974549d582bba189e0b2a1.json | compilers: use comma consistently | Library/Homebrew/compilers.rb | @@ -6,7 +6,7 @@ module CompilerConstants
"gcc-4.0" => :gcc_4_0,
"gcc-4.2" => :gcc,
"llvm-gcc" => :llvm,
- "clang" => :clang
+ "clang" => :clang,
}
COMPILERS = COMPILER_SYMBOL_MAP.values +
@@ -67,12 +67,12 @@ def inspect
create(:gcc => "4.3"),
create(:gcc => "4.4"),
... | false |
Other | Homebrew | brew | abd4c699d1f64be9794bcf28409c3a133322fc2c.json | pathname: remove redundant spacing | Library/Homebrew/extend/pathname.rb | @@ -177,7 +177,6 @@ def default_stat
end
private :default_stat
-
# @private
def cp_path_sub(pattern, replacement)
raise "#{self} does not exist" unless self.exist?
@@ -230,7 +229,6 @@ def rmdir_if_possible
false
end
-
# @private
def version
require "version" | false |
Other | Homebrew | brew | cff0c63d034b79c0d9766356f0532110a12a816c.json | test_intergration_cmds: fix minor typo | Library/Homebrew/test/test_integration_cmds.rb | @@ -109,7 +109,7 @@ def test_bottle
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
formula_file.write <<-EOS.undent
class Testball < Formula
- url "https://example.com/testabll-0.1.tar.gz"
+ url "https://example.com/testball-0.1.tar.gz"
end
EOS
HOMEBRE... | false |
Other | Homebrew | brew | 15fe924484f22a295f9b024b68f946e410c5531e.json | RubyRequirement: check all available ruby
Closes Homebrew/homebrew#47605.
Signed-off-by: Xu Cheng <xucheng@me.com> | Library/Homebrew/requirements/ruby_requirement.rb | @@ -9,14 +9,11 @@ def initialize(tags)
end
satisfy :build_env => false do
- next unless which "ruby"
- version = /\d\.\d/.match Utils.popen_read("ruby", "--version")
- next unless version
- Version.new(version.to_s) >= Version.new(@version)
- end
-
- env do
- ENV.prepend_path "PATH", which("rub... | false |
Other | Homebrew | brew | e1dfafa54ccf95d6abe5de28da53ea1e6406f567.json | Improve dash separated version detection.
* Also with test case.
Closes Homebrew/homebrew#47584.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/test/test_versions.rb | @@ -365,4 +365,8 @@ def test_opam_version
def test_waf_version
assert_version_detected "1.8.12", "https://waf.io/waf-1.8.12"
end
+
+ def test_dash_separated_version
+ assert_version_detected "6-20151227", "ftp://gcc.gnu.org/pub/gcc/snapshots/6-20151227/gcc-6-20151227.tar.bz2"
+ end
end | true |
Other | Homebrew | brew | e1dfafa54ccf95d6abe5de28da53ea1e6406f567.json | Improve dash separated version detection.
* Also with test case.
Closes Homebrew/homebrew#47584.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr> | Library/Homebrew/version.rb | @@ -312,7 +312,7 @@ def self._parse(spec)
return m.captures.first unless m.nil?
# e.g. lame-398-1
- m = /-((?:\d)+-\d)/.match(stem)
+ m = /-((?:\d)+-\d+)/.match(stem)
return m.captures.first unless m.nil?
# e.g. foobar-4.5.1 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.