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
316d8d756cb7a466060fd1f61d1b789956d064d7.json
Reduce scope of ensure block, remove conditionals
Library/Homebrew/extend/fileutils.rb
@@ -14,14 +14,17 @@ def mktemp(prefix=name) # /tmp volume to the other volume. So we let the user override the tmp # prefix if they need to. - tempd = with_system_path { `mktemp -d #{HOMEBREW_TEMP}/#{prefix}-XXXXXX` }.chuzzle - raise "Failed to create sandbox" if tempd.nil? + tempd = with_system_path { `mktemp -d #{HOMEBREW_TEMP}/#{prefix}-XXXXXX` }.strip + raise "Failed to create sandbox" if tempd.empty? prevd = pwd - cd tempd - yield - ensure - cd prevd if prevd - ignore_interrupts{ rm_r tempd } if tempd + cd(tempd) + + begin + yield + ensure + cd(prevd) + ignore_interrupts { rm_r(tempd) } + end end module_function :mktemp
false
Other
Homebrew
brew
f3e4b563d40335586a1de1d6bc6c36b48255b71e.json
Remove fish completion fish already ships more comprehensive completions which are enabled by default. Closes Homebrew/homebrew#37582.
Library/Contributions/brew_fish_completion.fish
@@ -1,160 +0,0 @@ -# fish (http://fishshell.org) completion script for brew(1) -# To install, symlink into (brew --prefix)/share/fish/completions -# or ~/.config/fish/completions with the name 'brew.fish' -# e.g.: -# mkdir -p ~/.config/fish/completions -# ln -s (brew --prefix)/Library/Contributions/brew_fish_completion.fish -# ~/.config/fish/completions/brew.fish - -for command in (ls (brew --repository)/Library/Homebrew/cmd | sed -e "s/\.rb//g") - set commands $command $commands -end - -for command in abv ln ls remove rm - set commands $command $commands -end - -function __fish_complete_brew_argument - set arguments (commandline -opc) - for cmd in $arguments - - if contains -- $cmd abv audit cat deps edit fetch home homepage info install log ls list options uses versions --cache --cellar --prefix - ls (brew --repository)/Library/Formula 2>/dev/null | sed 's/\.rb//g' - ls (brew --repository)/Library/Aliases 2>/dev/null | sed 's/\.rb//g' - for dir in (ls (brew --repository)/Library/Taps 2>/dev/null) - set tap (echo "$dir" | sed 's|-|/|g') - ls -1R (brew --repository)/Library/Taps/$dir 2>/dev/null | grep '.\+.rb' | sed -E 's|(.+).rb|'"$tap"'/\1|g' - end - return 0 - end - - if contains -- $cmd cleanup link ln missing rm remove test unlink uninstall upgrade pin unpin - ls (brew --prefix)/Cellar - return 0 - end - - if contains -- $cmd untap - ls (brew --repository)/Library/Taps 2>/dev/null | sed 's/-/\//g' - return 0 - end - - end -end - -function __fish_complete_brew_has_command - set arguments (commandline -opc) - - if [ (count $arguments) = 1 ] - return 1 - end - - for cmd in $arguments - if contains -- $cmd $commands - return 0 - end - end - return 1 - -end - -function __fish_complete_brew_command - set arguments (commandline -opc) - - for item in $argv - if contains -- $item $arguments - return 0 - end - end - return 1 -end - -function __fish_complete_brew_no_command - for cmd in (commandline -opc) - if contains -- $cmd $commands - return 1 - end - end - return 0 -end - -function __fish_brew_formula_arguments - set formulae (ls (brew --repository)/Library/Formula 2>/dev/null | sed 's/\.rb//g') - for formula in (ls (brew --repository)/Library/Aliases 2>/dev/null | sed 's/\.rb//g') - set formulae $formula $formulae - end - - for cmd in (commandline -opc) - if contains -- $cmd $formulae - brew options $cmd --compact | tr ' ' '\n' - end - end -end - -complete -c brew --arguments '(__fish_brew_formula_arguments)' -complete -c brew -x -a "$commands" -n '__fish_complete_brew_no_command' -complete -c brew -x -a '(__fish_complete_brew_argument)' -n '__fish_complete_brew_has_command' - -complete -c brew -s f -l force -n '__fish_complete_brew_command cleanup' -d "Remove out-of-date keg-only brews" -complete -c brew -s n -l dry-run -n '__fish_complete_brew_command cleanup' -d "Show what would be removed, but don't do anything" -complete -c brew -s s -n '__fish_complete_brew_command cleanup' -d "Remove all downloads" - -complete -c brew -l autotools -n '__fish_complete_brew_command create' -d "Use autotools template" -complete -c brew -l cmake -n '__fish_complete_brew_command create' -d "Use cmake template" -complete -c brew -l no-fetch -n '__fish_complete_brew_command create' -d "Do not download URL" - -complete -c brew -l 1 -n '__fish_complete_brew_command deps' -d "Only show dependencies one level down" -complete -c brew -s n -n '__fish_complete_brew_command deps' -d "Show dependencies in topological order" -complete -c brew -l tree -n '__fish_complete_brew_command deps' -d "Show dependencies as a tree" -complete -c brew -l all -n '__fish_complete_brew_command deps' -d "Show dependencies for all formulae" - -complete -c brew -l set-name -n '__fish_complete_brew_command diy' -d "Set package name" -f -complete -c brew -l set-version -n '__fish_complete_brew_command diy' -d "Set package version" -f - -complete -c brew -n '__fish_complete_brew_command doctor' -f - -complete -c brew -n '__fish_complete_brew_command edit' -x - -complete -c brew -s f -l force -n '__fish_complete_brew_command fetch' -d "Always redownload" -complete -c brew -l HEAD -n '__fish_complete_brew_command fetch' -d "Download HEAD version" -complete -c brew -l deps -n '__fish_complete_brew_command fetch' -d "Download dependencies" - -complete -c brew -n '__fish_complete_brew_command home' -x - -complete -c brew -l all -n '__fish_complete_brew_command info abv' -d "Show info for all formulae" -complete -c brew -l github -n '__fish_complete_brew_command info abv' -d "Open GitHub History page in browser" -x - -complete -c brew -s d -l debug -n '__fish_complete_brew_command install' -d "Open a shell if install fails" -complete -c brew -s f -l force -n '__fish_complete_brew_command force' -d "Install formula even if blacklisted" -complete -c brew -s i -l interactive -n '__fish_complete_brew_command install' -d "Open a subshell to install manually" -complete -c brew -l git -n '__fish_complete_brew_command install' -d 'Create a git repo (useful for making patches)' -complete -c brew -l build-from-source -n '__fish_complete_brew_command install' -d "Compile from source even if a bottle is provided" -complete -c brew -l devel -n '__fish_complete_brew_command install' -d "Install the development version" -complete -c brew -l HEAD -n '__fish_complete_brew_command install' -d "Install the HEAD version" - -complete -c brew -s f -l force -n '__fish_complete_brew_command link ln' -d "Overwrite files while linking" -complete -c brew -s n -l dry-run -n '__fish_complete_brew_command link ln' -d "Show which files would be deleted" - -complete -c brew -l unbrewed -n '__fish_complete_brew_command list ls' -d "List files in Homebrew prefix not installed by Homebrew" -complete -c brew -l pinned -n '__fish_complete_brew_command list ls' -d "Show the version number for (specified) pinned formulae" -complete -c brew -l versions -n '__fish_complete_brew_command list ls' -d "Show the version number for specified formulae" - -complete -c brew -n '__fish_complete_brew_command log' -u - -complete -c brew -l compact -n '__fish_complete_brew_command options' -d "Show options on a single line" -complete -c brew -l all -n '__fish_complete_brew_command options' -f -d "Show options for all formulae" -complete -c brew -l installed -n '__fish_complete_brew_command options' -f -d "Show options for all installed formulae" - -complete -c brew -l quiet -n '__fish_complete_brew_command outdated' -d "Do not print names of outdated brews" - -complete -c brew -s f -l force -n '__fish_complete_brew_command uninstall rm remove' -d "Delete all installed versions" - -complete -c brew -l macports -n '__fish_complete_brew_command search' -d "Search Macports package search page" -complete -c brew -l fink -n '__fish_complete_brew_command search' -d "Search Fink package search page" - -complete -c brew -l rebase -n '__fish_complete_brew_command update' -d "Use git pull --rebase" - -complete -c brew -l installed -n '__fish_complete_brew_command uses' -d "Only list installed formulae" - -complete -c brew -l compact -n '__fish_complete_brew_command versions' -d "Show all versions on a single line" - -complete -c brew -s v -l verbose -d "Print extra debugging information"
false
Other
Homebrew
brew
511c92158159843b15e33b05a2659b46a0f76a94.json
Move dbslayer to the boneyard Closes Homebrew/homebrew#37056. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Library/Homebrew/tap_migrations.rb
@@ -27,6 +27,7 @@ "curlftpfs" => "homebrew/x11", "cwm" => "homebrew/x11", "dart" => "dart-lang/dart", + "dbslayer" => "homebrew/boneyard", "ddd" => "homebrew/x11", "denyhosts" => "homebrew/boneyard", "dmenu" => "homebrew/x11",
false
Other
Homebrew
brew
68a8d1a5e7abe6a572e2973c244dfeeb49cfb289.json
test-bot: check syntax with readall. Closes Homebrew/homebrew#37471. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/test-bot.rb
@@ -505,7 +505,7 @@ def formula formula_name def homebrew @category = __method__ test "brew", "tests" - test "brew", "readall" + test "brew", "readall", "--syntax" end def cleanup_before
false
Other
Homebrew
brew
fb993934220bb2af300b6f8789a2c598165ed4c5.json
test-bot: fix ambiguous arguments.
Library/Homebrew/cmd/test-bot.rb
@@ -617,7 +617,7 @@ def test_bot tap ||= bot_argv.value('tap') end - tap.gsub! /homebrew\/homebrew-/i, "Homebrew/" if tap + tap.gsub!(/homebrew\/homebrew-/i, "Homebrew/") if tap git_url = ENV['UPSTREAM_GIT_URL'] || ENV['GIT_URL'] if !tap && git_url
false
Other
Homebrew
brew
36b7bae93cedfa59cba797f7ad3bdcdced700fb7.json
test-bot: remove unused variables.
Library/Homebrew/cmd/test-bot.rb
@@ -457,7 +457,6 @@ def formula formula_name if formula.stable? && !ARGV.include?('--no-bottle') bottle_args = ["--rb", canonical_formula_name] if @tap - tap_user, tap_repo = @tap.split "/" bottle_args << "--root-url=#{BottleSpecification::DEFAULT_DOMAIN}/#{Bintray.repository(@tap)}" end bottle_args << { :puts_output_on_success => true } @@ -569,8 +568,6 @@ def check_results def formulae changed_formulae_dependents = {} - dependencies = [] - non_dependencies = [] @formulae.each do |formula| formula_dependencies = Utils.popen_read("brew", "deps", formula).split("\n")
false
Other
Homebrew
brew
95a8a50aa0d968f6ab762bef7ca9f78bb7043463.json
install_renamed: ignore unused parameter.
Library/Homebrew/install_renamed.rb
@@ -1,5 +1,5 @@ module InstallRenamed - def install_p src, new_basename = nil + def install_p _, new_basename = nil super do |src, dst| dst += "/#{File.basename(src)}" if File.directory? dst
false
Other
Homebrew
brew
80714aaa7cd6278c5864e31b068a5d017ba6baed.json
uses: remove unused variable.
Library/Homebrew/cmd/uses.rb
@@ -31,7 +31,7 @@ def uses deps.any? { |dep| dep.to_formula.name == ff.name } || f.requirements.any? { |req| req.name == ff.name } end - rescue FormulaUnavailableError => e + rescue FormulaUnavailableError # Silently ignore this case as we don't care about things used in # taps that aren't currently tapped. end
false
Other
Homebrew
brew
1308070e66b3b4dbf979eceb2f374d3a3a81bb5d.json
pull: remove unused variable.
Library/Homebrew/cmd/pull.rb
@@ -109,7 +109,7 @@ def pull begin changed_formulae << Formula[name] # Make sure we catch syntax errors. - rescue Exception => e + rescue Exception next end end
false
Other
Homebrew
brew
57336ea68b13ec816c9403f03c437e3e503b2ca5.json
commands: move argument to fix warning.
Library/Homebrew/cmd/commands.rb
@@ -1,8 +1,9 @@ module Homebrew def commands # Find commands in Homebrew/cmd + with_directory = false cmds = (HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"). - children(with_directory=false). + children(with_directory). map {|f| File.basename(f, '.rb')} puts "Built-in commands" puts_columns cmds
false
Other
Homebrew
brew
3d71826e6dc794b0f3b6b9098ff0b49e3f997bfa.json
bottle: remove unused variable.
Library/Homebrew/cmd/bottle.rb
@@ -52,8 +52,6 @@ def print_filename string, filename result = false keg.each_unique_file_matching(string) do |file| - put_filename = false - # Check dynamic library linkage. Importantly, do not run otool on static # libraries, which will falsely report "linkage" to themselves. if file.mach_o_executable? or file.dylib? or file.mach_o_bundle?
false
Other
Homebrew
brew
11defcf847666adac44f0ff53a7f8ead9a7ac5f1.json
formula_versions: use Utils.popen_read instead of backticks Closes Homebrew/homebrew#37446. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/formula_versions.rb
@@ -47,7 +47,7 @@ def rev_list(branch="HEAD") end def file_contents_at_revision(rev) - repository.cd { `git cat-file blob #{rev}:#{entry_name}` } + repository.cd { Utils.popen_read("git", "cat-file", "blob", "#{rev}:#{entry_name}") } end def version_at_revision(rev)
false
Other
Homebrew
brew
144453368ed42c13e24143dd4e234795eb67f3cb.json
test-bot pathname: use Utils.popen_read instead of backticks Closes Homebrew/homebrew#37418. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/cmd/test-bot.rb
@@ -365,12 +365,12 @@ def formula formula_name end test "brew", "uses", canonical_formula_name - dependencies = `brew deps #{canonical_formula_name}`.split("\n") - dependencies -= `brew list`.split("\n") + dependencies = Utils.popen_read("brew", "deps", canonical_formula_name).split("\n") + dependencies -= Utils.popen_read("brew", "list").split("\n") unchanged_dependencies = dependencies - @formulae changed_dependences = dependencies - unchanged_dependencies - dependents = `brew uses --skip-build --skip-optional #{canonical_formula_name}`.split("\n") + dependents = Utils.popen_read("brew", "uses", "--skip-build", "--skip-optional", canonical_formula_name).split("\n") dependents -= @formulae dependents = dependents.map {|d| Formulary.factory(d)} @@ -573,7 +573,7 @@ def formulae non_dependencies = [] @formulae.each do |formula| - formula_dependencies = `brew deps #{formula}`.split("\n") + formula_dependencies = Utils.popen_read("brew", "deps", formula).split("\n") unchanged_dependencies = formula_dependencies - @formulae changed_dependences = formula_dependencies - unchanged_dependencies changed_dependences.each do |changed_formula|
true
Other
Homebrew
brew
144453368ed42c13e24143dd4e234795eb67f3cb.json
test-bot pathname: use Utils.popen_read instead of backticks Closes Homebrew/homebrew#37418. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/extend/pathname.rb
@@ -413,10 +413,11 @@ def install_metafiles from=Pathname.pwd end def abv - out='' - n=`find #{to_s} -type f ! -name .DS_Store | wc -l`.to_i + out = "" + n = Utils.popen_read("find", expand_path.to_s, "-type", "f", "!", "-name", ".DS_Store").split("\n").size out << "#{n} files, " if n > 1 - out << `/usr/bin/du -hs #{to_s} | cut -d"\t" -f1`.strip + out << Utils.popen_read("/usr/bin/du", "-hs", expand_path.to_s).split("\t")[0] + out end # We redefine these private methods in order to add the /o modifier to
true
Other
Homebrew
brew
4d5c1526665bda7ccd3948e388bec27001ddd1e7.json
Remove unnecessary nil check The backticks will either return a string or raise an exception, so `executable` cannot be nil.
Library/Homebrew/requirements/python_dependency.rb
@@ -36,9 +36,7 @@ def python_short_version def which_python python = which python_binary return unless python - executable = `#{python} -c "import sys; print(sys.executable)"`.strip - return unless executable - Pathname.new executable + Pathname.new Utils.popen_read(python, "-c", "import sys; print(sys.executable)").strip end def system_python; "/usr/bin/#{python_binary}" end
false
Other
Homebrew
brew
db772eee8a50f8adaaae01eac6b5a59053a0f330.json
Use env DSL
Library/Homebrew/requirements/python_dependency.rb
@@ -18,7 +18,7 @@ def pour_bottle? build? || system_python? end - def modify_build_environment + env do if system_python? if python_binary == "python" version = python_short_version
false
Other
Homebrew
brew
03d3f9d292808f7af908726a450629adca78c182.json
cmd/install: add force/debug/verbose to cask. Closes Homebrew/homebrew#37217.
Library/Homebrew/cmd/install.rb
@@ -31,9 +31,13 @@ def install if ARGV.casks.any? brew_cask = Formulary.factory("brew-cask") install_formula(brew_cask) unless brew_cask.installed? + args = [] + args << "--force" if ARGV.force? + args << "--debug" if ARGV.debug? + args << "--verbose" if ARGV.verbose? ARGV.casks.each do |c| - cmd = "brew", "cask", "install", c + cmd = "brew", "cask", "install", c, *args ohai cmd.join " " system(*cmd) end
false
Other
Homebrew
brew
f27f427d95bc181b67ee5522f4781b508e9d9df9.json
test-bot: use canonical names for taps.
Library/Homebrew/cmd/test-bot.rb
@@ -358,19 +358,25 @@ def setup def formula formula_name @category = "#{__method__}.#{formula_name}" - test "brew", "uses", formula_name - dependencies = `brew deps #{formula_name}`.split("\n") + canonical_formula_name = if @tap + "#{@tap}/#{formula_name}" + else + formula_name + end + + test "brew", "uses", canonical_formula_name + dependencies = `brew deps #{canonical_formula_name}`.split("\n") dependencies -= `brew list`.split("\n") unchanged_dependencies = dependencies - @formulae changed_dependences = dependencies - unchanged_dependencies - dependents = `brew uses --skip-build --skip-optional #{formula_name}`.split("\n") + dependents = `brew uses --skip-build --skip-optional #{canonical_formula_name}`.split("\n") dependents -= @formulae dependents = dependents.map {|d| Formulary.factory(d)} testable_dependents = dependents.select { |d| d.test_defined? && d.bottled? } - formula = Formulary.factory(formula_name) + formula = Formulary.factory(canonical_formula_name) installed_gcc = false deps = [] @@ -406,7 +412,7 @@ def formula formula_name OS::Mac.clear_version_cache retry end - skip formula_name + skip canonical_formula_name puts e.message return end @@ -422,9 +428,9 @@ def formula formula_name formula_fetch_options = [] formula_fetch_options << "--build-bottle" unless ARGV.include? "--no-bottle" formula_fetch_options << "--force" if ARGV.include? "--cleanup" - formula_fetch_options << formula_name + formula_fetch_options << canonical_formula_name test "brew", "fetch", "--retry", *formula_fetch_options - test "brew", "uninstall", "--force", formula_name if formula.installed? + test "brew", "uninstall", "--force", canonical_formula_name if formula.installed? install_args = %w[--verbose] install_args << "--build-bottle" unless ARGV.include? "--no-bottle" install_args << "--HEAD" if ARGV.include? "--HEAD" @@ -437,19 +443,19 @@ def formula formula_name install_args << "--HEAD" end - install_args << formula_name + install_args << canonical_formula_name # Don't care about e.g. bottle failures for dependencies. ENV["HOMEBREW_DEVELOPER"] = nil test "brew", "install", "--only-dependencies", *install_args unless dependencies.empty? ENV["HOMEBREW_DEVELOPER"] = "1" test "brew", "install", *install_args install_passed = steps.last.passed? - audit_args = [formula_name] + audit_args = [canonical_formula_name] audit_args << "--strict" if @added_formulae.include? formula_name test "brew", "audit", *audit_args if install_passed if formula.stable? && !ARGV.include?('--no-bottle') - bottle_args = ["--rb", formula_name] + bottle_args = ["--rb", canonical_formula_name] if @tap tap_user, tap_repo = @tap.split "/" bottle_args << "--root-url=#{BottleSpecification::DEFAULT_DOMAIN}/#{Bintray.repository(@tap)}" @@ -460,11 +466,11 @@ def formula formula_name if bottle_step.passed? and bottle_step.has_output? bottle_filename = bottle_step.output.gsub(/.*(\.\/\S+#{bottle_native_regex}).*/m, '\1') - test "brew", "uninstall", "--force", formula_name + test "brew", "uninstall", "--force", canonical_formula_name test "brew", "install", bottle_filename end end - test "brew", "test", "--verbose", formula_name if formula.test_defined? + test "brew", "test", "--verbose", canonical_formula_name if formula.test_defined? testable_dependents.each do |dependent| unless dependent.installed? test "brew", "fetch", "--retry", dependent.name @@ -480,18 +486,18 @@ def formula formula_name test "brew", "test", "--verbose", dependent.name end end - test "brew", "uninstall", "--force", formula_name + test "brew", "uninstall", "--force", canonical_formula_name end if formula.devel && formula.stable? && !ARGV.include?('--HEAD') \ && satisfied_requirements?(formula, :devel) test "brew", "fetch", "--retry", "--devel", *formula_fetch_options - test "brew", "install", "--devel", "--verbose", formula_name + test "brew", "install", "--devel", "--verbose", canonical_formula_name devel_install_passed = steps.last.passed? test "brew", "audit", "--devel", *audit_args if devel_install_passed - test "brew", "test", "--devel", "--verbose", formula_name if formula.test_defined? - test "brew", "uninstall", "--devel", "--force", formula_name + test "brew", "test", "--devel", "--verbose", canonical_formula_name if formula.test_defined? + test "brew", "uninstall", "--devel", "--force", canonical_formula_name end end test "brew", "uninstall", "--force", *unchanged_dependencies unless unchanged_dependencies.empty? @@ -614,6 +620,8 @@ def test_bot tap ||= bot_argv.value('tap') end + tap.gsub! /homebrew\/homebrew-/i, "Homebrew/" if tap + git_url = ENV['UPSTREAM_GIT_URL'] || ENV['GIT_URL'] if !tap && git_url # Also can get tap from Jenkins GIT_URL. @@ -672,7 +680,7 @@ def test_bot if !repository.directory? safe_system "brew", "tap", tap else - safe_system "brew", "tap", "--repair" + quiet_system "brew", "tap", "--repair" end end
false
Other
Homebrew
brew
17bfb0f804555cfaef70e64a1c7fcc5697195f48.json
Remove SourceForge references. It was fun but we just love Bintray more than you. Closes Homebrew/homebrew#37211. Closes Homebrew/homebrew#37213. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/test-bot.rb
@@ -452,11 +452,7 @@ def formula formula_name bottle_args = ["--rb", formula_name] if @tap tap_user, tap_repo = @tap.split "/" - if ENV["HOMEBREW_SOURCEFORGE_TESTING"] - bottle_args << "--root-url=#{BottleSpecification::DEFAULT_ROOT_URL}/#{tap_repo}" - else - bottle_args << "--root-url=#{BottleSpecification::DEFAULT_DOMAIN}/#{Bintray.repository(@tap)}" - end + bottle_args << "--root-url=#{BottleSpecification::DEFAULT_DOMAIN}/#{Bintray.repository(@tap)}" end bottle_args << { :puts_output_on_success => true } test "brew", "bottle", *bottle_args @@ -746,7 +742,6 @@ def test_bot tag = pr ? "pr-#{pr}" : "testing-#{number}" safe_system "git", "push", "--force", remote, "master:master", ":refs/tags/#{tag}" - # Bintray upload (will take over soon) bintray_repo = Bintray.repository(tap) bintray_repo_url = "https://api.bintray.com/packages/homebrew/#{bintray_repo}" formula_packaged = {} @@ -775,19 +770,6 @@ def test_bot puts end - # SourceForge upload (will be removed soon) - path = "/home/frs/project/m/ma/machomebrew/Bottles/" - if tap - tap_user, tap_repo = tap.split "/" - path += "#{tap_repo}/" - end - url = "BrewTestBot,machomebrew@frs.sourceforge.net:#{path}" - - rsync_args = %w[--partial --progress --human-readable --compress] - rsync_args += Dir["*.bottle*.tar.gz"] + [url] - - safe_system "rsync", *rsync_args - safe_system "git", "tag", "--force", tag safe_system "git", "push", "--force", remote, "refs/tags/#{tag}" return
true
Other
Homebrew
brew
17bfb0f804555cfaef70e64a1c7fcc5697195f48.json
Remove SourceForge references. It was fun but we just love Bintray more than you. Closes Homebrew/homebrew#37211. Closes Homebrew/homebrew#37213. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/download_strategy.rb
@@ -372,12 +372,6 @@ def _fetch # This strategy extracts our binary packages. class CurlBottleDownloadStrategy < CurlDownloadStrategy - def curl(*args) - mirror = ENV["HOMEBREW_SOURCEFORGE_MIRROR"] - args << "-G" << "-d" << "use_mirror=#{mirror}" if mirror - super - end - def stage ohai "Pouring #{cached_location.basename}" super
true
Other
Homebrew
brew
17bfb0f804555cfaef70e64a1c7fcc5697195f48.json
Remove SourceForge references. It was fun but we just love Bintray more than you. Closes Homebrew/homebrew#37211. Closes Homebrew/homebrew#37213. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/manpages/brew.1.md
@@ -562,12 +562,6 @@ can take several different forms: Text printed before the installation summary of each successful build. Defaults to the beer emoji. - * HOMEBREW\_SOURCEFORGE\_MIRROR: - If set, Homebrew will use the value of `HOMEBREW_SOURCEFORGE_MIRROR` to - select a SourceForge mirror for downloading bottles. - - *Example:* `export HOMEBREW_SOURCEFORGE_MIRROR='heanet'` - * HOMEBREW\_SVN: When exporting from Subversion, Homebrew will use `HOMEBREW_SVN` if set, a Homebrew-built Subversion if installed, or the system-provided binary.
true
Other
Homebrew
brew
17bfb0f804555cfaef70e64a1c7fcc5697195f48.json
Remove SourceForge references. It was fun but we just love Bintray more than you. Closes Homebrew/homebrew#37211. Closes Homebrew/homebrew#37213. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/software_spec.rb
@@ -251,12 +251,8 @@ def build_url(root_url, filename) class BottleSpecification DEFAULT_PREFIX = "/usr/local".freeze DEFAULT_CELLAR = "/usr/local/Cellar".freeze - if ENV["HOMEBREW_SOURCEFORGE_TESTING"] - DEFAULT_ROOT_URL = "https://downloads.sf.net/project/machomebrew/Bottles".freeze - else - DEFAULT_DOMAIN = "https://homebrew.bintray.com".freeze - DEFAULT_ROOT_URL = "#{DEFAULT_DOMAIN}/bottles".freeze - end + DEFAULT_DOMAIN = "https://homebrew.bintray.com".freeze + DEFAULT_ROOT_URL = "#{DEFAULT_DOMAIN}/bottles".freeze attr_rw :root_url, :prefix, :cellar, :revision attr_reader :checksum, :collector
true
Other
Homebrew
brew
17bfb0f804555cfaef70e64a1c7fcc5697195f48.json
Remove SourceForge references. It was fun but we just love Bintray more than you. Closes Homebrew/homebrew#37211. Closes Homebrew/homebrew#37213. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/test/test_versions.rb
@@ -230,35 +230,35 @@ def test_debian_style_2 end def test_bottle_style - assert_version_detected '4.8.0', 'https://downloads.sf.net/project/machomebrew/Bottles/qt-4.8.0.lion.bottle.tar.gz' + assert_version_detected '4.8.0', 'https://homebrew.bintray.com/bottles/qt-4.8.0.lion.bottle.tar.gz' end def test_versioned_bottle_style - assert_version_detected '4.8.1', 'https://downloads.sf.net/project/machomebrew/Bottles/qt-4.8.1.lion.bottle.1.tar.gz' + assert_version_detected '4.8.1', 'https://homebrew.bintray.com/bottles/qt-4.8.1.lion.bottle.1.tar.gz' end def test_erlang_bottle_style - assert_version_detected 'R15B', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B.lion.bottle.tar.gz' + assert_version_detected 'R15B', 'https://homebrew.bintray.com/bottles/erlang-R15B.lion.bottle.tar.gz' end def test_another_erlang_bottle_style - assert_version_detected 'R15B01', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B01.mountain_lion.bottle.tar.gz' + assert_version_detected 'R15B01', 'https://homebrew.bintray.com/bottles/erlang-R15B01.mountain_lion.bottle.tar.gz' end def test_yet_another_erlang_bottle_style - assert_version_detected 'R15B03-1', 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B03-1.mountainlion.bottle.tar.gz' + assert_version_detected 'R15B03-1', 'https://homebrew.bintray.com/bottles/erlang-R15B03-1.mountainlion.bottle.tar.gz' end def test_imagemagick_style assert_version_detected '6.7.5-7', 'http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.7.5-7.tar.bz2' end def test_imagemagick_bottle_style - assert_version_detected '6.7.5-7', 'https://downloads.sf.net/project/machomebrew/Bottles/imagemagick-6.7.5-7.lion.bottle.tar.gz' + assert_version_detected '6.7.5-7', 'https://homebrew.bintray.com/bottles/imagemagick-6.7.5-7.lion.bottle.tar.gz' end def test_imagemagick_versioned_bottle_style - assert_version_detected '6.7.5-7', 'https://downloads.sf.net/project/machomebrew/Bottles/imagemagick-6.7.5-7.lion.bottle.1.tar.gz' + assert_version_detected '6.7.5-7', 'https://homebrew.bintray.com/bottles/imagemagick-6.7.5-7.lion.bottle.1.tar.gz' end def test_dash_version_dash_style
true
Other
Homebrew
brew
17bfb0f804555cfaef70e64a1c7fcc5697195f48.json
Remove SourceForge references. It was fun but we just love Bintray more than you. Closes Homebrew/homebrew#37211. Closes Homebrew/homebrew#37213. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
share/man/man1/brew.1
@@ -584,13 +584,6 @@ HOMEBREW_INSTALL_BADGE Text printed before the installation summary of each successful build\. Defaults to the beer emoji\. . .TP -HOMEBREW_SOURCEFORGE_MIRROR -If set, Homebrew will use the value of \fBHOMEBREW_SOURCEFORGE_MIRROR\fR to select a SourceForge mirror for downloading bottles\. -. -.IP -\fIExample:\fR \fBexport HOMEBREW_SOURCEFORGE_MIRROR=\'heanet\'\fR -. -.TP HOMEBREW_SVN When exporting from Subversion, Homebrew will use \fBHOMEBREW_SVN\fR if set, a Homebrew\-built Subversion if installed, or the system\-provided binary\. .
true
Other
Homebrew
brew
328fa80f413af936fb1612156208d27c42dd4697.json
pathname: skip directory in env_script_all_files Closes Homebrew/homebrew#37180. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/extend/pathname.rb
@@ -382,6 +382,7 @@ def write_env_script target, env def env_script_all_files dst, env dst.mkpath Pathname.glob("#{self}/*") do |file| + next if file.directory? dst.install_p file new_file = dst+file.basename file.write_env_script(new_file, env)
false
Other
Homebrew
brew
da25d3e5797317e78076f7ab5f2caa5f4815e064.json
Move adobe-air-sdk to homebrew/binary Closes Homebrew/homebrew#37104. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/tap_migrations.rb
@@ -1,4 +1,5 @@ TAP_MIGRATIONS = { + "adobe-air-sdk" => "homebrew/binary", "agedu" => "homebrew/head-only", "aimage" => "homebrew/boneyard", "aplus" => "homebrew/boneyard",
false
Other
Homebrew
brew
39473f769413c1239aeb99d6c7b5ce564461fb43.json
audit: fix FormulaText match It's used in `audit_text` Closes Homebrew/homebrew#37139. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/cmd/audit.rb
@@ -69,6 +69,14 @@ def has_END? def has_trailing_newline? /\Z\n/ =~ @text end + + def =~ regex + regex =~ @text + end + + def !~ regex + regex !~ @text + end end class FormulaAuditor
false
Other
Homebrew
brew
346ad93f901b50f200c5f869cf77fa727abe0d23.json
SUPPORTERS: add some (very) late links.
SUPPORTERS.md
@@ -179,7 +179,7 @@ These brilliant people supported our Kickstarter by giving us £15 or more: * [Nick Jones](mailto:nick@dischord.org) * [Esmé Cowles](https://github.com/escowles) * [Garrett L. Ward](http://glward.net) -* Carl Laird +* [Carl Laird](http://allthingsoptimal.com) * [Mx A. Matienzo](http://matienzo.org/) * [Sean Dunn](http://www.dunns.me) * [Kara Van Malssen](http://avpreserve.com) @@ -439,7 +439,7 @@ These wonderful people supported our Kickstarter by giving us £10 or more: * [Derek Croft](http://www.kiindly.com) * [Doc Ritezel](http://ritezel.com) * [Christoph Heer](http://christophheer.me) -* Jakub Suder +* [Kuba Suder](http://mackuba.eu) * [Jason Garber](http://sixtwothree.org) * [Alejandro Caceres](http://punkspider.hyperiongray.com) * [Slobodan Miskovic](https://miskovic.ca)
false
Other
Homebrew
brew
64d9c16942b972439a2fbfc4a0ff5f69b0fd0023.json
test-bot: pass tap argument to bottle --write.
Library/Homebrew/cmd/test-bot.rb
@@ -736,7 +736,9 @@ def test_bot ENV["GIT_AUTHOR_NAME"] = ENV["GIT_COMMITTER_NAME"] ENV["GIT_AUTHOR_EMAIL"] = ENV["GIT_COMMITTER_EMAIL"] - safe_system "brew", "bottle", "--merge", "--write", *Dir["*.bottle.rb"] + bottle_args = ["--merge", "--write", *Dir["*.bottle.rb"]] + bottle_args << "--tap=#{tap}" if tap + safe_system "brew", "bottle", *bottle_args remote_repo = tap ? tap.gsub("/", "-") : "homebrew"
false
Other
Homebrew
brew
30a8d8e470ea75e5796b7df9591a676a1a6fa429.json
bottle: --write: use canonical name with tap arg.
Library/Homebrew/cmd/bottle.rb
@@ -237,7 +237,13 @@ def merge puts output if ARGV.include? '--write' - f = Formulary.factory(formula_name) + tap = ARGV.value('tap') + canonical_formula_name = if tap + "#{tap}/#{formula_name}" + else + formula_name + end + f = Formulary.factory(canonical_formula_name) update_or_add = nil Utils::Inreplace.inreplace(f.path) do |s|
false
Other
Homebrew
brew
cf3ee4546f782a0bbe082e97c9746c5ad9b04841.json
add inspect to Requirement subclass Closes Homebrew/homebrew#37116. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/requirements.rb
@@ -43,6 +43,10 @@ def message EOS end end + + def inspect + "#<#{self.class.name}: #{name.inspect} #{tags.inspect} version=#{@version.inspect}>" + end end class MysqlDependency < Requirement
true
Other
Homebrew
brew
cf3ee4546f782a0bbe082e97c9746c5ad9b04841.json
add inspect to Requirement subclass Closes Homebrew/homebrew#37116. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/requirements/mpi_dependency.rb
@@ -34,6 +34,10 @@ def mpi_wrapper_works? compiler quiet_system compiler, '--version' end + def inspect + "#<#{self.class.name}: #{name.inspect} #{tags.inspect} lang_list=#{@lang_list.inspect}>" + end + satisfy do @lang_list.each do |lang| case lang
true
Other
Homebrew
brew
1f541f7dfb5ae373acfd9831792d1e4cdd6948ea.json
test-bot: upload packages from canonical name.
Library/Homebrew/cmd/test-bot.rb
@@ -725,8 +725,12 @@ def test_bot existing_bottles = {} Dir.glob("*.bottle*.tar.gz") do |filename| formula_name = bottle_filename_formula_name filename - formula = Formulary.factory formula_name rescue nil - next unless formula + canonical_formula_name = if tap + "#{tap}/#{formula_name}" + else + formula_name + end + formula = Formulary.factory canonical_formula_name existing_bottles[formula_name] = !!formula.bottle end
false
Other
Homebrew
brew
e50badf11c517f0be661da2050a02aa0b0554caa.json
pull: use link_tap_formula method.
Library/Homebrew/cmd/pull.rb
@@ -3,6 +3,7 @@ require 'utils' require 'formula' +require 'cmd/tap' module Homebrew def tap arg @@ -92,9 +93,9 @@ def pull pull_url url changed_formulae = [] + changed_formulae_paths = [] if tap_dir - safe_system "brew", "tap", "--repair", "--debug" formula_dir = %w[Formula HomebrewFormula].find { |d| tap_dir.join(d).directory? } || "" else formula_dir = "Library/Formula" @@ -104,7 +105,9 @@ def pull "git", "diff-tree", "-r", "--name-only", "--diff-filter=AM", revision, "HEAD", "--", formula_dir ).each_line do |line| - name = File.basename(line.chomp, ".rb") + line = line.chomp + name = File.basename(line, ".rb") + changed_formulae_paths << Pathname.new("#{formula_dir}/#{line}") begin changed_formulae << Formula[name] @@ -114,6 +117,8 @@ def pull end end + link_tap_formula(changed_formulae_paths, false) + unless ARGV.include? '--bottle' changed_formulae.each do |f| next unless f.bottle
false
Other
Homebrew
brew
7926ea171c84b8fe5439cb4969533f316a941d8e.json
README: add xu-cheng to maintainers.
README.md
@@ -20,7 +20,7 @@ Second, read the [Troubleshooting Checklist](https://github.com/Homebrew/homebre Please report security issues to security@brew.sh. ## Who Are You? -Homebrew's current maintainers are [Misty De Meo](https://github.com/mistydemeo), [Adam Vandenberg](https://github.com/adamv), [Jack Nagel](https://github.com/jacknagel), [Mike McQuaid](https://github.com/mikemcquaid), [Brett Koonce](https://github.com/asparagui) and [Tim Smith](https://github.com/tdsmith). +Homebrew's current maintainers are [Misty De Meo](https://github.com/mistydemeo), [Adam Vandenberg](https://github.com/adamv), [Jack Nagel](https://github.com/jacknagel), [Xu Cheng](https://github.com/xu-cheng), [Mike McQuaid](https://github.com/mikemcquaid), [Brett Koonce](https://github.com/asparagui) and [Tim Smith](https://github.com/tdsmith). Homebrew was originally created by [Max Howell](https://github.com/mxcl).
false
Other
Homebrew
brew
22cf99094f7944de1c7989235c628c599dc760c7.json
Set the path on "fake" install receipts
Library/Homebrew/tab.rb
@@ -101,7 +101,7 @@ def self.dummy_tab f=nil :stdlib => nil, :compiler => "clang", :source => { - :path => nil, + :path => f ? f.path.to_s : nil, }, }
false
Other
Homebrew
brew
77d47de3b482b78782dec7fdd1392a7dee436a38.json
Switch bottle provider over to Bintray.
Library/Homebrew/software_spec.rb
@@ -251,11 +251,11 @@ def build_url(root_url, filename) class BottleSpecification DEFAULT_PREFIX = "/usr/local".freeze DEFAULT_CELLAR = "/usr/local/Cellar".freeze - if ENV["HOMEBREW_BINTRAY_TESTING"] + if ENV["HOMEBREW_SOURCEFORGE_TESTING"] + DEFAULT_ROOT_URL = "https://downloads.sf.net/project/machomebrew/Bottles".freeze + else DEFAULT_DOMAIN = "https://homebrew.bintray.com".freeze DEFAULT_ROOT_URL = "#{DEFAULT_DOMAIN}/bottles".freeze - else - DEFAULT_ROOT_URL = "https://downloads.sf.net/project/machomebrew/Bottles".freeze end attr_rw :root_url, :prefix, :cellar, :revision
false
Other
Homebrew
brew
e773d0c3b915edfc490c0c6f57f2f1cead88c64e.json
pull: use Bintray package naming.
Library/Homebrew/cmd/pull.rb
@@ -161,14 +161,15 @@ def pull bintray_key = ENV["BINTRAY_KEY"] if bintray_user && bintray_key - bintray_repo = Bintray.repository(tap_name) + repo = Bintray.repository(tap_name) changed_formulae.each do |f| next unless `git show --oneline --no-patch` =~ /: add .+ bottle./ ohai "Publishing on Bintray:" + package = Bintray.package f.name version = Bintray.version(f.bottle.url) curl "--silent", "--fail", "-u#{bintray_user}:#{bintray_key}", "-X", "POST", - "https://api.bintray.com/content/homebrew/#{bintray_repo}/#{f.name}/#{version}/publish" + "https://api.bintray.com/content/homebrew/#{repo}/#{package}/#{version}/publish" puts end end
false
Other
Homebrew
brew
e5f145ababc6635024260820c98af6e0980a9662.json
test-bot: use Bintray package naming.
Library/Homebrew/cmd/test-bot.rb
@@ -747,24 +747,25 @@ def test_bot Dir.glob("*.bottle*.tar.gz") do |filename| version = Bintray.version filename - formula = bottle_filename_formula_name filename - existing_bottle = existing_bottles[formula] + formula_name = bottle_filename_formula_name filename + bintray_package = Bintray.package formula_name + existing_bottle = existing_bottles[formula_name] # Disable taps temporarily until Bintray sorts our repositories. next if tap - unless formula_packaged[formula] - package_url = "#{bintray_repo_url}/#{formula}" + unless formula_packaged[formula_name] + package_url = "#{bintray_repo_url}/#{bintray_package}" unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url curl "--silent", "--fail", "-u#{bintray_user}:#{bintray_key}", "-H", "Content-Type: application/json", - "-d", "{\"name\":\"#{formula}\"}", bintray_repo_url + "-d", "{\"name\":\"#{bintray_package}\"}", bintray_repo_url puts end - formula_packaged[formula] = true + formula_packaged[formula_name] = true end - content_url = "https://api.bintray.com/content/homebrew/#{bintray_repo}/#{formula}/#{version}/#{filename}" + content_url = "https://api.bintray.com/content/homebrew/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}" content_url += "?publish=1&override=1" if existing_bottle curl "--silent", "--fail", "-u#{bintray_user}:#{bintray_key}", "-T", filename, content_url
false
Other
Homebrew
brew
857da689bfd513b11ea050102b00c69340a6fa90.json
test-bot: add flag to reset repository and taps.
Library/Homebrew/cmd/test-bot.rb
@@ -16,10 +16,11 @@ # --dry-run: Just print commands, don't run them. # --fail-fast: Immediately exit on a failing step. # -# --ci-master: Shortcut for Homebrew master branch CI options. -# --ci-pr: Shortcut for Homebrew pull request CI options. -# --ci-testing: Shortcut for Homebrew testing CI options. -# --ci-upload: Homebrew CI bottle upload. +# --ci-master: Shortcut for Homebrew master branch CI options. +# --ci-pr: Shortcut for Homebrew pull request CI options. +# --ci-testing: Shortcut for Homebrew testing CI options. +# --ci-upload: Homebrew CI bottle upload. +# --ci-reset-and-update: Homebrew CI repository and tap reset and update. require 'formula' require 'utils' @@ -660,6 +661,15 @@ def test_bot end end + if ARGV.include? "--ci-reset-and-update" + safe_system "git", "reset", "--hard" + Dir.glob("#{HOMEBREW_LIBRARY}/Taps/*/*") do |tap| + cd tap { safe_system "git", "reset", "--hard" } + end + safe_system "brew", "update" + return + end + if ARGV.include? '--ci-upload' jenkins = ENV['JENKINS_HOME'] job = ENV['UPSTREAM_JOB_NAME']
false
Other
Homebrew
brew
a0980f05a1399a434b057e551995847fa9db4e64.json
test-bot: fix tap variable naming.
Library/Homebrew/cmd/test-bot.rb
@@ -722,7 +722,7 @@ def test_bot safe_system "git", "push", "--force", remote, "master:master", ":refs/tags/#{tag}" # Bintray upload (will take over soon) - bintray_repo = Bintray.repository(tap_name) + bintray_repo = Bintray.repository(tap) bintray_repo_url = "https://api.bintray.com/packages/homebrew/#{bintray_repo}" formula_packaged = {}
false
Other
Homebrew
brew
e303a97aa710e781c9ccb0b5b7c7675f26862be3.json
bottles: add Bintray class. For some utility functions.
Library/Homebrew/bottles.rb
@@ -46,6 +46,17 @@ def bottle_filename_formula_name filename basename.rpartition("-#{version}").first end +class Bintray + def self.repository(tap=nil) + return "bottles" if tap.to_s.empty? + "bottles-#{tap.sub(/^homebrew\/homebrew-/i, "")}" + end + + def self.version(path) + BottleVersion.parse(path).to_s + end +end + class BottleCollector def initialize @checksums = {}
false
Other
Homebrew
brew
258c4ddefe60f65570aee2aef9243eb23a6ee5a9.json
pull: check bottle commit URL before branching. Otherwise we annoyingly end up on a branch unnecessarily.
Library/Homebrew/cmd/pull.rb
@@ -141,13 +141,16 @@ def pull end if ARGV.include? "--bottle" - bottle_branch = "pull-bottle-#{issue}" - safe_system "git", "checkout", "-B", bottle_branch, revision - if tap_name - pull_url "https://github.com/BrewTestBot/homebrew-#{tap_name}/compare/homebrew:master...pr-#{issue}" + bottle_commit_url = if tap_name + "https://github.com/BrewTestBot/homebrew-#{tap_name}/compare/homebrew:master...pr-#{issue}" else - pull_url "https://github.com/BrewTestBot/homebrew/compare/homebrew:master...pr-#{issue}" + "https://github.com/BrewTestBot/homebrew/compare/homebrew:master...pr-#{issue}" end + curl "--silent", "--fail", "-o", "/dev/null", "-I", bottle_commit_url + + bottle_branch = "pull-bottle-#{issue}" + safe_system "git", "checkout", "-B", bottle_branch, revision + pull_url bottle_commit_url safe_system "git", "rebase", branch safe_system "git", "checkout", branch safe_system "git", "merge", "--ff-only", "--no-edit", bottle_branch
false
Other
Homebrew
brew
40e64263226d4017b2437fbd5fd777c41ab3f063.json
audit: give better suggestion on git/hg dependency Closes Homebrew/homebrew#36959. Signed-off-by: Xu Cheng <xucheng@me.com>
Library/Homebrew/cmd/audit.rb
@@ -174,8 +174,12 @@ def audit_deps Or if it is indeed a runtime denpendency depends_on "#{dep}" => :run EOS - when "git", "ruby", "mercurial" - problem "Don't use #{dep} as a dependency. We allow non-Homebrew #{dep} installations." + when "git" + problem "Use `depends_on :git` instead of `depends_on 'git'`" + when "mercurial" + problem "Use `depends_on :hg` instead of `depends_on 'mercurial'`" + when "ruby" + problem "Don't use ruby as a dependency. We allow non-Homebrew ruby installations." when 'gfortran' problem "Use `depends_on :fortran` instead of `depends_on 'gfortran'`" when 'open-mpi', 'mpich2'
false
Other
Homebrew
brew
e92a87179a2f90d8a43731b67adcd0b0b104a0eb.json
Use ternary instead of inline rescue
Library/Homebrew/tab.rb
@@ -92,7 +92,7 @@ def self.for_formula f def self.dummy_tab f=nil attributes = { :used_options => [], - :unused_options => (f.options.as_flags rescue []), + :unused_options => f ? f.options.as_flags : [], :built_as_bottle => false, :poured_from_bottle => false, :tapped_from => "",
false
Other
Homebrew
brew
579f288bd2507d781d315e9fcc56ea6d52eaefee.json
test-bot: construct formula object correctly.
Library/Homebrew/cmd/test-bot.rb
@@ -707,8 +707,9 @@ def test_bot Dir.glob("*.bottle*.tar.gz") do |filename| # Skip taps for now until we're using Bintray for Homebrew/homebrew next if tap - formula = bottle_filename_formula_name filename - existing_bottles[formula.name] = !!formula.bottle + formula_name = bottle_filename_formula_name filename + formula = Formulary.factory formula_name + existing_bottles[formula_name] = !!formula.bottle end ENV["GIT_AUTHOR_NAME"] = ENV["GIT_COMMITTER_NAME"] @@ -733,7 +734,7 @@ def test_bot next if tap version = BottleVersion.parse(filename).to_s formula = bottle_filename_formula_name filename - existing_bottle = existing_bottles[formula.name] + existing_bottle = existing_bottles[formula] repo_url = "https://api.bintray.com/packages/homebrew/#{repo}" package_url = "#{repo_url}/#{formula}"
false
Other
Homebrew
brew
675991eb611af0a970dce6945f5b882c4343875f.json
pull: publish bottles on Bintray.
Library/Homebrew/cmd/pull.rb
@@ -153,9 +153,25 @@ def pull safe_system "git", "merge", "--ff-only", "--no-edit", bottle_branch safe_system "git", "branch", "-D", bottle_branch - # TODO: publish on bintray - # safe_system "curl", "-u#{user}:#{key}", "-X", "POST", - # "https://api.bintray.com/content/homebrew/#{repo}/#{formula}/#{version}" + # Publish bottles on Bintray + bintray_user = ENV["BINTRAY_USER"] + bintray_key = ENV["BINTRAY_KEY"] + bintray_repo = if tap_name + tap_name.sub("/", "-") + "-bottles" + else + "bottles" + end + + # Skip taps for now until we're using Bintray for Homebrew/homebrew + if bintray_user && bintray_key && !tap_name + changed_formulae.each do |f| + ohai "Publishing on Bintray:" + safe_system "curl", "--silent", "--fail", + "-u#{bintray_user}:#{bintray_key}", "-X", "POST", + "https://api.bintray.com/content/homebrew/#{bintray_repo}/#{f.name}/#{f.version}/publish" + puts + end + end end ohai 'Patch changed:'
false
Other
Homebrew
brew
e9e2be94040b103c5d5cf45755d487294120a0ab.json
test-bot: autopublish existing bottles on Bintray.
Library/Homebrew/cmd/test-bot.rb
@@ -664,11 +664,14 @@ def test_bot jenkins = ENV['JENKINS_HOME'] job = ENV['UPSTREAM_JOB_NAME'] id = ENV['UPSTREAM_BUILD_ID'] - raise "Missing Jenkins variables!" unless jenkins and job and id + raise "Missing Jenkins variables!" if !jenkins || !job || !id - user = ENV["BINTRAY_USER"] - key = ENV["BINTRAY_KEY"] - raise "Missing Bintray variables!" unless user && key + bintray_user = ENV["BINTRAY_USER"] + bintray_key = ENV["BINTRAY_KEY"] + # Skip taps for now until we're using Bintray for Homebrew/homebrew + if !tap && (!bintray_user || !bintray_key) + raise "Missing BINTRAY_USER or BINTRAY_KEY variables!" + end ARGV << '--verbose' @@ -700,6 +703,14 @@ def test_bot safe_system "brew", "pull", "--clean", pull_pr end + existing_bottles = {} + Dir.glob("*.bottle*.tar.gz") do |filename| + # Skip taps for now until we're using Bintray for Homebrew/homebrew + next if tap + formula = bottle_filename_formula_name filename + existing_bottles[formula.name] = !!formula.bottle + end + ENV["GIT_AUTHOR_NAME"] = ENV["GIT_COMMITTER_NAME"] ENV["GIT_AUTHOR_EMAIL"] = ENV["GIT_COMMITTER_EMAIL"] safe_system "brew", "bottle", "--merge", "--write", *Dir["*.bottle.rb"] @@ -710,19 +721,6 @@ def test_bot tag = pr ? "pr-#{pr}" : "testing-#{number}" safe_system "git", "push", "--force", remote, "master:master", ":refs/tags/#{tag}" - # SourceForge upload (will be removed soon) - path = "/home/frs/project/m/ma/machomebrew/Bottles/" - if tap - tap_user, tap_repo = tap.split "/" - path += "#{tap_repo}/" - end - url = "BrewTestBot,machomebrew@frs.sourceforge.net:#{path}" - - rsync_args = %w[--partial --progress --human-readable --compress] - rsync_args += Dir["*.bottle*.tar.gz"] + [url] - - safe_system "rsync", *rsync_args - # Bintray upload (will take over soon) repo = if tap tap.sub("/", "-") + "-bottles" @@ -735,22 +733,38 @@ def test_bot next if tap version = BottleVersion.parse(filename).to_s formula = bottle_filename_formula_name filename + existing_bottle = existing_bottles[formula.name] repo_url = "https://api.bintray.com/packages/homebrew/#{repo}" package_url = "#{repo_url}/#{formula}" unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url - safe_system "curl", "--silent", "--fail", "-u#{user}:#{key}", + safe_system "curl", "--silent", "--fail", + "-u#{bintray_user}:#{bintray_key}", "-H", "Content-Type: application/json", "-d", "{\"name\":\"#{formula}\"}", repo_url puts end content_url = "https://api.bintray.com/content/homebrew/#{repo}/#{formula}/#{version}/#{filename}" - safe_system "curl", "--silent", "--fail", "-u#{user}:#{key}", - "-T", filename, content_url + content_url += "?publish=1&override=1" if existing_bottle + safe_system "curl", "--silent", "--fail", + "-u#{bintray_user}:#{bintray_key}", "-T", filename, content_url puts end + # SourceForge upload (will be removed soon) + path = "/home/frs/project/m/ma/machomebrew/Bottles/" + if tap + tap_user, tap_repo = tap.split "/" + path += "#{tap_repo}/" + end + url = "BrewTestBot,machomebrew@frs.sourceforge.net:#{path}" + + rsync_args = %w[--partial --progress --human-readable --compress] + rsync_args += Dir["*.bottle*.tar.gz"] + [url] + + safe_system "rsync", *rsync_args + safe_system "git", "tag", "--force", tag safe_system "git", "push", "--force", remote, "refs/tags/#{tag}" return
false
Other
Homebrew
brew
4f13858fe8af6dc385c2cd80ed127ea05d216180.json
Fix a couple of formatting issues in man page
Library/Homebrew/manpages/brew.1.md
@@ -237,7 +237,7 @@ Note that these flags should only appear after a command. If `--force` is passed, Homebrew will allow keg-only formulae to be linked. - * `linkapps [--local] [<formulae>]`: + * `linkapps [--local]` [<formulae>]: Find installed formulae that have compiled `.app`-style "application" packages for OS X, and symlink those apps into `/Applications`, allowing for easier access. @@ -360,7 +360,7 @@ Note that these flags should only appear after a command. for temporarily disabling a formula: `brew unlink foo && commands && brew link foo`. - * `unlinkapps [--local] [<formulae>]`: + * `unlinkapps [--local]` [<formulae>]: Removes links created by `brew linkapps`. If no <formulae> are provided, all linked app will be removed.
true
Other
Homebrew
brew
4f13858fe8af6dc385c2cd80ed127ea05d216180.json
Fix a couple of formatting issues in man page
share/man/man1/brew.1
@@ -254,7 +254,7 @@ If \fB\-\-dry\-run\fR or \fB\-n\fR is passed, Homebrew will list all files which If \fB\-\-force\fR is passed, Homebrew will allow keg\-only formulae to be linked\. . .TP -\fBlinkapps [\-\-local] [<formulae>]\fR +\fBlinkapps [\-\-local]\fR [\fIformulae\fR] Find installed formulae that have compiled \fB\.app\fR\-style "application" packages for OS X, and symlink those apps into \fB/Applications\fR, allowing for easier access\. . .IP @@ -382,7 +382,7 @@ Example: \fBbrew install jruby && brew test jruby\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\. . .TP -\fBunlinkapps [\-\-local] [<formulae>]\fR +\fBunlinkapps [\-\-local]\fR [\fIformulae\fR] Removes links created by \fBbrew linkapps\fR\. . .IP
true
Other
Homebrew
brew
67828cd01523fed03b3e59780862a405f0c5b7dc.json
test-bot: specify bintray username/password.
Library/Homebrew/cmd/test-bot.rb
@@ -738,8 +738,9 @@ def test_bot package_url = "https://api.bintray.com/packages/homebrew/#{repo}/#{formula}" unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url - safe_system "curl", "-H", "Content-Type: application/json", - "-d", "{'name':'#{formula}','licenses':['MIT']}", package_url + safe_system "curl", "-u#{user}:#{key}", + "-H", "Content-Type: application/json", + "-d", "{'name':'#{formula}'}", package_url end safe_system "curl", "-u#{user}:#{key}", "-T", filename,
false
Other
Homebrew
brew
51956d343a5b38a683db9afe51e39dabbd715ac0.json
audit: extend ssl checks Extends the audit checks to GnuPG, a significant chunk of Freedesktop domains, and Github Pages. I’ve somewhat hardened my stance towards Github Pages from the last time we extended this, hence the new inclusion - I did a pretty thorough check through the Homebrew formulae that use Github Pages for homepage links and found very few places where enforcing SSL/TLS would cause issues - I think a wider enforcement is worthwhile. I’ve also fixed the capitalisation of the taps, if only because at the moment it disagrees with what ` puts formula.tap ` outputs (We get Homebrew/homebrew-head-only rather than homebrew/homebrew-head-only for example). Closes Homebrew/homebrew#36719. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/audit.rb
@@ -243,13 +243,40 @@ def audit_urls problem "Savannah homepages should be https:// links (URL is #{homepage})." end + if homepage =~ %r[^http://((?:trac|tools|www)\.)?ietf\.org] + problem "ietf homepages should be https:// links (URL is #{homepage})." + end + + if homepage =~ %r[^http://((?:www)\.)?gnupg.org/] + problem "GnuPG homepages should be https:// links (URL is #{homepage})." + end + + # Freedesktop is complicated to handle - It has SSL/TLS, but only on certain subdomains. + # To enable https Freedesktop change the url from http://project.freedesktop.org/wiki to + # https://wiki.freedesktop.org/project_name. + # "Software" is redirected to https://wiki.freedesktop.org/www/Software/project_name + if homepage =~ %r[^http://((?:www|nice|libopenraw|liboil|telepathy|xorg)\.)?freedesktop\.org/(?:wiki/)?] + if homepage =~ /Software/ + problem "The url should be styled `https://wiki.freedesktop.org/www/Software/project_name`, not #{homepage})." + else + problem "The url should be styled `https://wiki.freedesktop.org/project_name`, not #{homepage})." + end + end + + if homepage =~ %r[^http://wiki\.freedesktop\.org/] + problem "Freedesktop's Wiki subdomain should be https:// (URL is #{homepage})." + end + # There's an auto-redirect here, but this mistake is incredibly common too. if homepage =~ %r[^http://packages\.debian\.org] problem "Debian homepage should be https:// links (URL is #{homepage})." end - if homepage =~ %r[^http://((?:trac|tools|www)\.)?ietf\.org] - problem "ietf homepages should be https:// links (URL is #{homepage})." + # People will run into mixed content sometimes, but we should enforce and then add + # exemptions as they are discovered. Treat mixed content on homepages as a bug. + # Justify each exemptions with a code comment so we can keep track here. + if homepage =~ %r[^http://[^/]*github\.io/] + problem "Github Pages links should be https:// (URL is #{homepage})." end # There's an auto-redirect here, but this mistake is incredibly common too. @@ -360,11 +387,11 @@ def audit_urls end def audit_specs - if head_only?(formula) && formula.tap != "homebrew/homebrew-head-only" + if head_only?(formula) && formula.tap != "Homebrew/homebrew-head-only" problem "Head-only (no stable download)" end - if devel_only?(formula) && formula.tap != "homebrew/homebrew-devel-only" + if devel_only?(formula) && formula.tap != "Homebrew/homebrew-devel-only" problem "Devel-only (no stable download)" end
false
Other
Homebrew
brew
3f3b7746dda4a36a05ad3c6bda32526dbeea5c19.json
Fix another filesystem leak in updater tests
Library/Homebrew/test/test_updater.rb
@@ -51,6 +51,10 @@ def setup @report = Report.new end + def teardown + FileUtils.rm_rf HOMEBREW_LIBRARY.join("Taps") + end + def perform_update(fixture_name="") @updater.diff = fixture(fixture_name) @updater.in_repo_expect("git checkout -q master")
false
Other
Homebrew
brew
6648f976fbd96772b3664774a543a9d124eb1699.json
Remove unnecessary use of Dir[]
Library/Homebrew/download_strategy.rb
@@ -672,7 +672,7 @@ def initialize(name, resource) end def stage - cp_r Dir[cached_location+"{.}"], Dir.pwd + cp_r File.join(cached_location, "."), Dir.pwd end private @@ -751,7 +751,7 @@ def initialize(name, resource) def stage # The export command doesn't work on checkouts # See https://bugs.launchpad.net/bzr/+bug/897511 - cp_r Dir[cached_location+"{.}"], Dir.pwd + cp_r File.join(cached_location, "."), Dir.pwd rm_r ".bzr" end
false
Other
Homebrew
brew
d0e2d126a1969c6cf3d975576108a8da2c618254.json
audit: catch empty installations Closes Homebrew/homebrew#36794. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/audit.rb
@@ -668,6 +668,24 @@ def audit_line(line, lineno) end end + def audit_prefix_has_contents + return unless formula.prefix.directory? + + Pathname.glob("#{formula.prefix}/**/*") do |file| + next if file.directory? + basename = file.basename.to_s + next if Metafiles.copy?(basename) + next if %w[.DS_Store INSTALL_RECEIPT.json].include?(basename) + return + end + + problem <<-EOS.undent + The installation seems to be empty. Please ensure the prefix + is set correctly and expected files are installed. + The prefix configure/make argument may be case-sensitive. + EOS + end + def audit_conditional_dep(dep, condition, line) quoted_dep = quote_dep(dep) dep = Regexp.escape(dep.to_s) @@ -700,6 +718,7 @@ def audit audit_text text.without_patch.split("\n").each_with_index { |line, lineno| audit_line(line, lineno+1) } audit_installed + audit_prefix_has_contents end private
false
Other
Homebrew
brew
e34d9a7b37101062c79a98ade47fe141a9b8e149.json
outdated: handle HEAD, URL and path installation. Handles edge cases missed in Homebrew/homebrew#36699. Closes Homebrew/homebrew#36741. Closes Homebrew/homebrew#36760. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/outdated.rb
@@ -23,9 +23,11 @@ def outdated_brews(formulae) keg = Keg.new dir version = keg.version all_versions << version + same_or_head_version = f.version == version || version.head? tap = Tab.for_keg(keg).tapped_from - if f.tap == tap || f.version == version + same_or_path_url_tap = f.tap == tap || tap == HOMEBREW_PATH_URL_TAP + if same_or_path_url_tap || same_or_head_version same_tap_versions << version end end
false
Other
Homebrew
brew
384c444be89eae07df858174e995bbc10079e05b.json
Drop unnecessary call to compact
Library/ENV/4.3/cc
@@ -118,7 +118,7 @@ class Cmd args + cppflags when :ld ldflags + args - end.compact + end make_fuss(allflags) allflags end
false
Other
Homebrew
brew
28b926686b59b7ed6a10a1c478ccce699fb217e6.json
Get the basename and dirname once
Library/ENV/4.3/cc
@@ -29,8 +29,8 @@ class Cmd attr_reader :config, :prefix, :cellar, :tmpdir, :sysroot attr_reader :archflags, :optflags - def initialize path, args - @arg0 = File.basename(path).freeze + def initialize(arg0, args) + @arg0 = arg0 @args = args.freeze @config = ENV.fetch("HOMEBREW_CCCFG") { "" } @prefix = ENV['HOMEBREW_PREFIX'] @@ -332,14 +332,16 @@ if __FILE__ == $PROGRAM_NAME ####################################################################### main - LOGGER.puts "#{File.basename($0)} called with: #{ARGV.join(" ")}" + dirname, basename = File.split($0) - cmd = Cmd.new($0, ARGV) + LOGGER.puts "#{basename} called with: #{ARGV.join(" ")}" + + cmd = Cmd.new(basename, ARGV) tool, args = cmd.tool, cmd.args LOGGER.puts "superenv executed: #{tool} #{args.join(" ")}" LOGGER.log! args << { :close_others => false } if RUBY_VERSION >= "2.0" - exec "#{File.dirname($0)}/xcrun", tool, *args + exec "#{dirname}/xcrun", tool, *args end
false
Other
Homebrew
brew
2320c0a6c1130dd24d7f73c073c66ad798caa8b0.json
pull: copy new subject when bumping.
Library/Homebrew/cmd/pull.rb
@@ -129,6 +129,7 @@ def pull f = changed_formulae.first subject = "#{f.name} #{f.version}" ohai "New bump commit subject: #{subject}" + system "/bin/echo -n #{subject} | pbcopy" message = "#{subject}\n\n#{message}" end
false
Other
Homebrew
brew
4d17d4c8dbef49a9ed9fd174ed2ac2f8a7b4e9a6.json
gist-logs: show the formula origin for non core-formula Closes Homebrew/homebrew#36730. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/gist-logs.rb
@@ -12,6 +12,14 @@ def gistify_logs f Homebrew.dump_verbose_config(s) files["config.out"] = { :content => s.string } files["doctor.out"] = { :content => `brew doctor 2>&1` } + unless f.core_formula? + tap = <<-EOS.undent + Formula: #{f.name} + Tap: #{f.tap} + Path: #{f.path} + EOS + files["tap.out"] = { :content => tap } + end url = create_gist(files)
false
Other
Homebrew
brew
f640cbac9ed83abab64e4dcb4b630f6765fd2962.json
brew uses: parse ARGV properly `ARGV.flag?` = `ARGV.include?` + `ARGV.switch?` Closes Homebrew/homebrew#36727. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/uses.rb
@@ -12,8 +12,8 @@ def uses formulae = (ARGV.include? "--installed") ? Formula.installed : Formula recursive = ARGV.flag? "--recursive" ignores = [] - ignores << "build?" if ARGV.flag? "--skip-build" - ignores << "optional?" if ARGV.flag? "--skip-optional" + ignores << "build?" if ARGV.include? "--skip-build" + ignores << "optional?" if ARGV.include? "--skip-optional" uses = formulae.select do |f| used_formulae.all? do |ff|
false
Other
Homebrew
brew
8e12390fc8d9b198dd4b68ca20c0108e5d60e1a5.json
Update Example Formula documentation. I feel like we’re probably fighting a losing battle here, but here’s a bundle more updates to the example formula to cover some ground not already covered. Closes Homebrew/homebrew#36644. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Contributions/example-formula.rb
@@ -30,8 +30,8 @@ class ExampleFormula < Formula version "1.2-final" # For integrity and security, we verify the hash (`openssl dgst -sha1 <FILE>`) - # You may also use sha256 if the software uses sha256 on their homepage. - # Leave it empty at first and `brew install` will tell you the expected. + # You may also use sha256 if the software uses sha256 on their homepage. Do not use md5. + # Either generate the sha locally or leave it empty & `brew install` will tell you the expected. sha1 "cafebabe78901234567890123456789012345678" # Stable-only dependencies should be nested inside a `stable` block rather than @@ -48,6 +48,7 @@ class ExampleFormula < Formula # Optionally, specify a repository to be used. Brew then generates a # `--HEAD` option. Remember to also test it. # The download strategies (:using =>) are the same as for `url`. + # "master" is the default branch and doesn't need stating with a :branch conditional head "https://we.prefer.https.over.git.example.com/.git" head "https://example.com/.git", :branch => "name_of_branch", :revision => "abc123" head "https://hg.is.awesome.but.git.has.won.example.com/", :using => :hg # If autodetect fails. @@ -89,6 +90,8 @@ class ExampleFormula < Formula # Bottles are pre-built and added by the Homebrew maintainers for you. # 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 + # You can ignore this block entirely if submitting to Homebrew/Homebrew, It'll be + # handled for you by the Brew Test Bot. bottle do root_url "http://mikemcquaid.com" # Optional root to calculate bottle URLs prefix "/opt/homebrew" # Optional HOMEBREW_PREFIX in which the bottles were built. @@ -154,7 +157,7 @@ def pour_bottle? depends_on :arch => :x86_64 # If this formula only build on intel x86 64bit. depends_on :arch => :ppc # Only builds on PowerPC? depends_on :ld64 # Sometimes ld fails on `MacOS.version < :leopard`. Then use this. - depends_on :x11 # X11/XQuartz components. + depends_on :x11 # X11/XQuartz components. Non-optional X11 deps should go in Homebrew/Homebrew-x11 depends_on :osxfuse # Permits the use of the upstream signed binary or our source package. depends_on :tuntap # Does the same thing as above. This is vital for Yosemite and above. depends_on :mysql => :recommended @@ -166,6 +169,8 @@ def pour_bottle? # If any Python >= 2.7 < 3.x is okay (either from OS X or brewed): depends_on :python + # to depend on Python >= 2.7 but use system Python where possible + depends_on :python if MacOS.version <= :snow_leopard # Python 3.x if the `--with-python3` is given to `brew install example` depends_on :python3 => :optional @@ -188,7 +193,7 @@ def pour_bottle? end fails_with :clang do - build 425 + build 600 cause "multiple configure and compile errors" end @@ -271,6 +276,19 @@ def install args << "--some-new-stuff" if build.head? # if head is used instead of url. args << "--universal-binary" if build.universal? + # If there are multiple conditional arguments use a block instead of lines. + if build.head? + args << "--i-want-pizza" + args << "--and-a-cold-beer" if build.with? "cold-beer" + end + + # If a formula presents a user with a choice, but the choice must be fulfilled: + if build.with? "example2" + args << "--with-example2" + else + args << "--with-example1" + end + # The `build.with?` and `build.without?` are smart enough to do the # right thing with respect to defaults defined via `:optional` and # `:recommended` dependencies. @@ -282,12 +300,12 @@ def install # break if they remember that exact path. In contrast to that, the # `$(brew --prefix)/opt/formula` is the same path for all future # versions of the formula! - args << "--with-readline=#{Formula["readline"].opt_prefix}/lib" if build.with? "readline" + args << "--with-readline=#{Formula["readline"].opt_prefix}" if build.with? "readline" # Most software still uses `configure` and `make`. # Check with `./configure --help` what our options are. system "./configure", "--disable-debug", "--disable-dependency-tracking", - "--prefix=#{prefix}", + "--disable-silent-rules", "--prefix=#{prefix}", *args # our custom arg list (needs `*` to unpack) # If your formula's build system is not thread safe: @@ -305,7 +323,30 @@ def install # Overwriting any env var: ENV["LDFLAGS"] = "--tag CC" - + # Is the formula struggling to find the pkgconfig file? Point it to it. + # This is done automatically for `keg_only` formulae. + ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["glib"].opt_lib}/pkgconfig" + + # Need to install into the bin but the makefile doesn't mkdir -p prefix/bin? + bin.mkpath + # A custom directory? + mkdir_p share/"example" + # And then move something from the buildpath to that directory? + mv "ducks.txt", share/"example/ducks.txt" + # No "make", "install" available? + bin.install "binary1" + include.install "example.h" + lib.install "example.dylib" + man1.install "example.1" + man3.install "example.3" + # All that README/LICENSE/NOTES/CHANGELOG stuff? Use "metafiles" + prefix.install_metafiles + # Maybe you'd like to remove a broken or unnecessary element? + # Empty directories will be removed by Homebrew automatically post-install! + rm "bin/example" + rm_rf "share/pointless" + + # If there is a "make", "install" available, please use it! system "make", "install" # We are in a temporary directory and don't have to care about cleanup. @@ -423,11 +464,20 @@ def plist; <<-EOS.undent <plist version="1.0"> <dict> <key>Label</key> - <string>#{plist_name}</string> + <string>#{plist_name}</string> + <key>ProgramArguments</key> + <array> + <string>#{bin}/example</string> + <string>--do-this</string> + </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> + <key>StandardErrorPath</key> + <string>/dev/null</string> + <key>StandardOutPath</key> + <string>/dev/null</string> </plist> EOS end
true
Other
Homebrew
brew
8e12390fc8d9b198dd4b68ca20c0108e5d60e1a5.json
Update Example Formula documentation. I feel like we’re probably fighting a losing battle here, but here’s a bundle more updates to the example formula to cover some ground not already covered. Closes Homebrew/homebrew#36644. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
share/doc/homebrew/Formula-Cookbook.md
@@ -81,7 +81,7 @@ Formulae aren’t that complicated. [etl](https://github.com/Homebrew/homebrew/b And then [Git](https://github.com/Homebrew/homebrew/tree/master/Library/Formula/git.rb) and [flac](https://github.com/Homebrew/homebrew/tree/master/Library/Formula/flac.rb) show more advanced functionality. -A more complete [cheat-sheet](https://github.com/Homebrew/homebrew/blob/master/Library/Contributions/example-formula.rb) shows almost all the stuff you can use in a Formula. +A more complete example-formula [cheat-sheet](https://github.com/Homebrew/homebrew/blob/master/Library/Contributions/example-formula.rb) shows almost all the stuff you can use in a Formula. ## Grab the URL
true
Other
Homebrew
brew
e547438ff43426e31dac3ef070b2feecd8a4621b.json
cmd/info: prevent duplicate dependency display. Before: $ brew info llvm ==> Dependencies Build: xz ✔, xz ✔, xz ✔, xz ✔, xz ✔, xz ✔ $ brew info --json=v1 llvm ... "dependencies":["xz","xz","xz","xz","xz","xz"], ... After $ brew info llvm ==> Dependencies Build: xz ✔ $ brew info --json=v1 llvm ... "dependencies":["xz"], ... Closes Homebrew/homebrew#36653. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/info.rb
@@ -122,7 +122,7 @@ def info_formula f unless f.deps.empty? ohai "Dependencies" %w{build required recommended optional}.map do |type| - deps = f.deps.send(type) + deps = f.deps.send(type).uniq puts "#{type.capitalize}: #{decorate_dependencies deps}" unless deps.empty? end end
true
Other
Homebrew
brew
e547438ff43426e31dac3ef070b2feecd8a4621b.json
cmd/info: prevent duplicate dependency display. Before: $ brew info llvm ==> Dependencies Build: xz ✔, xz ✔, xz ✔, xz ✔, xz ✔, xz ✔ $ brew info --json=v1 llvm ... "dependencies":["xz","xz","xz","xz","xz","xz"], ... After $ brew info llvm ==> Dependencies Build: xz ✔ $ brew info --json=v1 llvm ... "dependencies":["xz"], ... Closes Homebrew/homebrew#36653. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/formula.rb
@@ -593,7 +593,7 @@ def to_hash "installed" => [], "linked_keg" => (linked_keg.resolved_path.basename.to_s if linked_keg.exist?), "keg_only" => keg_only?, - "dependencies" => deps.map(&:name), + "dependencies" => deps.map(&:name).uniq, "conflicts_with" => conflicts.map(&:name), "caveats" => caveats }
true
Other
Homebrew
brew
2abd3298f9520b25550b4f5b27884452b4ddec13.json
audit: catch more examples from example_formula See https://github.com/Homebrew/homebrew/pull/36629#discussion_r24293912 amongst other recent examples. The example formula isn’t as strongly policed as the ` brew create ` default, this tries to do something about that. Closes Homebrew/homebrew#36639. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/audit.rb
@@ -455,9 +455,18 @@ def audit_line(line, lineno) if line =~ /# PLEASE REMOVE/ problem "Please remove default template comments" end + if line =~ /# Documentation:/ + problem "Please remove default template comments" + end if line =~ /# if this fails, try separate make\/make install steps/ problem "Please remove default template comments" end + if line =~ /# The url of the archive/ + problem "Please remove default template comments" + end + if line =~ /## Naming --/ + problem "Please remove default template comments" + end if line =~ /# if your formula requires any X11\/XQuartz components/ problem "Please remove default template comments" end
false
Other
Homebrew
brew
357d0f279614c1c18f709f2dd4e310ad388d3915.json
Use start_with? to simplify path sanity check
Library/ENV/4.3/cc
@@ -199,15 +199,7 @@ class Cmd end def keep? path - case path - when %r{^#{Regexp.escape(prefix)}}o, %r{^#{Regexp.escape(cellar)}}o, %r{^#{Regexp.escape(tmpdir)}}o - # maybe homebrew is installed to /sw or /opt/brew - true - when %r{^/opt}, %r{^/sw}, %r{/usr/X11} - false - else - true - end + path.start_with?(prefix, cellar, tmpdir) || !path.start_with?("/opt", "/sw", "/usr/X11") end def cflags
false
Other
Homebrew
brew
4851b1e7a877246d57ca87e9e48b7d962f100015.json
Use a local instead of an instance variable
Library/Homebrew/formula.rb
@@ -621,7 +621,7 @@ def verify_download_integrity fn end def run_test - @oldhome = ENV["HOME"] + old_home = ENV["HOME"] self.build = Tab.for_formula(self) mktemp do @testpath = Pathname.pwd @@ -630,7 +630,7 @@ def run_test end ensure @testpath = nil - ENV["HOME"] = @oldhome + ENV["HOME"] = old_home end def test_defined?
false
Other
Homebrew
brew
e40d302deeb8e1011d4f0c9dc3aa1ceafefb654c.json
audit_installed: give better Python advice Update advice about easy-install.pth files. Closes Homebrew/homebrew#36547.
Library/Homebrew/formula_cellar_checks.rb
@@ -127,8 +127,7 @@ def check_easy_install_pth lib <<-EOS.undent easy-install.pth files were found These .pth files are likely to cause link conflicts. Please invoke - setup.py with options - --single-version-externally-managed --record=install.txt + setup.py using Language::Python.setup_install_args. The offending files are #{pth_found * "\n "} EOS
false
Other
Homebrew
brew
d362f5a2fbc82810f819a7d024b92fee4813cf3e.json
Remove message that is never displayed Requirements with default formulae cannot fail the build.
Library/Homebrew/requirements/apr_dependency.rb
@@ -14,27 +14,4 @@ class AprDependency < Requirement ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["apr-util"].opt_libexec}/lib/pkgconfig" end end - - def message - message = <<-EOS.undent - Due to packaging problems on Apple's part, software that compiles - against APR requires the standalone Command Line Tools. - EOS - if MacOS.version >= :mavericks - message += <<-EOS.undent - Either - `brew install apr-util` - or - `xcode-select --install` - to install APR. - EOS - else - message += <<-EOS.undent - The standalone package can be obtained from - https://developer.apple.com/downloads/, - or it can be installed via Xcode's preferences. - Or you can `brew install apr-util`. - EOS - end - end end
false
Other
Homebrew
brew
5e854164a7a11cb6bf44e8dde414dc0c703fa52e.json
untap: Handle multiple arguments Closes Homebrew/homebrew#36436. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/tap.rb
@@ -108,8 +108,8 @@ def each_tap end end - def tap_args - ARGV.first =~ HOMEBREW_TAP_ARGS_REGEX + def tap_args(tap_name=ARGV.first) + tap_name =~ HOMEBREW_TAP_ARGS_REGEX raise "Invalid tap name" unless $1 && $3 [$1, $3] end
true
Other
Homebrew
brew
5e854164a7a11cb6bf44e8dde414dc0c703fa52e.json
untap: Handle multiple arguments Closes Homebrew/homebrew#36436. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/untap.rb
@@ -4,25 +4,27 @@ module Homebrew def untap raise "Usage is `brew untap <tap-name>`" if ARGV.empty? - user, repo = tap_args - - # we consistently downcase in tap to ensure we are not bitten by case-insensive - # filesystem issues. Which is the default on mac. The problem being the - # filesystem cares, but our regexps don't. So unless we resolve *every* path - # we will get bitten. - user.downcase! - repo.downcase! - - tapd = HOMEBREW_LIBRARY/"Taps/#{user}/homebrew-#{repo}" - - raise "No such tap!" unless tapd.directory? - - files = [] - tapd.find_formula { |file| files << file } - unlink_tap_formula(files) - tapd.rmtree - tapd.dirname.rmdir_if_possible - puts "Untapped #{files.length} formula#{plural(files.length, 'e')}" + ARGV.each do |tapname| + user, repo = tap_args(tapname) + + # we consistently downcase in tap to ensure we are not bitten by case-insensive + # filesystem issues. Which is the default on mac. The problem being the + # filesystem cares, but our regexps don't. So unless we resolve *every* path + # we will get bitten. + user.downcase! + repo.downcase! + + tapd = HOMEBREW_LIBRARY/"Taps/#{user}/homebrew-#{repo}" + + raise "No such tap!" unless tapd.directory? + + files = [] + tapd.find_formula { |file| files << file } + unlink_tap_formula(files) + tapd.rmtree + tapd.dirname.rmdir_if_possible + puts "Untapped #{files.length} formula#{plural(files.length, 'e')}" + end end def unlink_tap_formula paths
true
Other
Homebrew
brew
e298f09ab6a50929a61880c3649779ceab98b4bb.json
Move mysqlreport to the boneyard The project was deprecated in favor of percona-toolkit: http://blog.codenode.com/2015/01/hack-mysql-has-been-retired.html Closes Homebrew/homebrew#36342.
Library/Homebrew/tap_migrations.rb
@@ -104,6 +104,7 @@ "msgpack-rpc" => "homebrew/boneyard", "mupdf" => "homebrew/x11", "mydumper" => "homebrew/boneyard", + "mysqlreport" => "homebrew/boneyard", "newick-utils" => "homebrew/science", "nlopt" => "homebrew/science", "octave" => "homebrew/science",
false
Other
Homebrew
brew
649579072ca7a0f5fe2576f78499a7a35597161f.json
Move cdf to the boneyard Closes Homebrew/homebrew#36009.
Library/Homebrew/tap_migrations.rb
@@ -15,6 +15,7 @@ "cantera" => "homebrew/science", "cardpeek" => "homebrew/x11", "catdoc" => "homebrew/boneyard", + "cdf" => "homebrew/boneyard", "clam" => "homebrew/boneyard", "cloudfoundry-cli" => "pivotal/tap", "clusterit" => "homebrew/x11",
false
Other
Homebrew
brew
a9c4091de733e54cc73bab7e0fe0b729f5f6bde6.json
Fix more version misdetections for URLs with archs Closes Homebrew/homebrew#36368. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/test/test_versions.rb
@@ -353,7 +353,13 @@ def test_win_style def test_with_arch assert_version_detected '4.0.18-1', 'http://ftpmirror.gnu.org/mtools/mtools-4.0.18-1.i686.rpm' + assert_version_detected '5.5.7-5', + 'http://ftpmirror.gnu.org/autogen/autogen-5.5.7-5.i386.rpm' assert_version_detected '2.8', 'http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x86.zip' + assert_version_detected '2.8', + 'http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x64.zip' + assert_version_detected '4.0.18', + 'http://ftpmirror.gnu.org/mtools/mtools_4.0.18_i386.deb' end end
true
Other
Homebrew
brew
a9c4091de733e54cc73bab7e0fe0b729f5f6bde6.json
Fix more version misdetections for URLs with archs Closes Homebrew/homebrew#36368. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/version.rb
@@ -273,8 +273,9 @@ def self._parse spec return m.captures.first.gsub('_', '.') unless m.nil? # e.g. foobar-4.5.1-1 + # e.g. unrtf_0.20.4-1 # e.g. ruby-1.9.1-p243 - m = /-((?:\d+\.)*\d\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem) + m = /[-_]((?:\d+\.)*\d\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem) return m.captures.first unless m.nil? # e.g. lame-398-1 @@ -299,8 +300,11 @@ def self._parse spec return m.captures.first unless m.nil? # e.g. http://ftpmirror.gnu.org/mtools/mtools-4.0.18-1.i686.rpm + # e.g. http://ftpmirror.gnu.org/autogen/autogen-5.5.7-5.i386.rpm # e.g. http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x86.zip - m = /-(\d+\.\d+(?:\.\d+)?(?:-\d+)?)[-_.](?:i686|x86(?:[-_](?:32|64))?)$/.match(stem) + # e.g. http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x64.zip + # e.g. http://ftpmirror.gnu.org/mtools/mtools_4.0.18_i386.deb + m = /[-_](\d+\.\d+(?:\.\d+)?(?:-\d+)?)[-_.](?:i[36]86|x86|x64(?:[-_](?:32|64))?)$/.match(stem) return m.captures.first unless m.nil? # e.g. foobar4.5.1
true
Other
Homebrew
brew
a9e8dfb9960b6d3c75f7152a16f7496b41679943.json
Fix version misdetections for URLs with OS/archs Closes Homebrew/homebrew#36308. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/test/test_versions.rb
@@ -342,4 +342,18 @@ def test_aespipe_version_style assert_version_detected '2.4c', 'http://loop-aes.sourceforge.net/aespipe/aespipe-v2.4c.tar.bz2' end + + def test_win_style + assert_version_detected '0.9.17', + 'http://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-0.9.17-w32.zip' + assert_version_detected '1.29', + 'http://ftpmirror.gnu.org/libidn/libidn-1.29-win64.zip' + end + + def test_with_arch + assert_version_detected '4.0.18-1', + 'http://ftpmirror.gnu.org/mtools/mtools-4.0.18-1.i686.rpm' + assert_version_detected '2.8', + 'http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x86.zip' + end end
true
Other
Homebrew
brew
a9e8dfb9960b6d3c75f7152a16f7496b41679943.json
Fix version misdetections for URLs with OS/archs Closes Homebrew/homebrew#36308. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/version.rb
@@ -293,6 +293,16 @@ def self._parse spec m = /-((?:\d+\.)*\d+-beta\d*)$/.match(stem) return m.captures.first unless m.nil? + # e.g. http://ftpmirror.gnu.org/libidn/libidn-1.29-win64.zip + # e.g. http://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-0.9.17-w32.zip + m = /-(\d+\.\d+(?:\.\d+)?)-w(?:in)?(?:32|64)$/.match(stem) + return m.captures.first unless m.nil? + + # e.g. http://ftpmirror.gnu.org/mtools/mtools-4.0.18-1.i686.rpm + # e.g. http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x86.zip + m = /-(\d+\.\d+(?:\.\d+)?(?:-\d+)?)[-_.](?:i686|x86(?:[-_](?:32|64))?)$/.match(stem) + return m.captures.first unless m.nil? + # e.g. foobar4.5.1 m = /((?:\d+\.)*\d+)$/.match(stem) return m.captures.first unless m.nil?
true
Other
Homebrew
brew
eaba2607c4a2f58a9dab0bc910c571b477e2a762.json
Add brewdler tap to documentation.
share/doc/homebrew/Interesting-Taps-&-Branches.md
@@ -41,11 +41,14 @@ Homebrew has the capability to add (and remove) multiple taps to your local inst - Formula are not deleted, they are moved here. * [homebrew/nginx](https://github.com/Homebrew/homebrew-nginx) - - Feature rich Nginx tap for modules + - Feature rich Nginx tap for modules. * [homebrew/binary](https://github.com/Homebrew/homebrew-binary) - Precompiled binary formulae. +* [homebrew/brewdler](https://github.com/Homebrew/homebrew-brewdler) + - A Bundler-equivalent for installing project dependencies from Homebrew. + `brew search` looks in these main taps and as well in [Homebrew/homebrew](https://github.com/Homebrew/homebrew). So don't worry about missing stuff. We will add other taps to the search as they become well maintained and popular.
false
Other
Homebrew
brew
f0fc15ade8cdff5ad50da4a6d5b900ab3cd1dd90.json
Remove unnecessary early return Iterating over an empty list is a no-op so we can remove this early return.
Library/Homebrew/formula.rb
@@ -761,7 +761,6 @@ def stage def prepare_patches active_spec.add_legacy_patches(patches) - return if patchlist.empty? patchlist.grep(DATAPatch) { |p| p.path = path }
false
Other
Homebrew
brew
797820946922d8c043f320adeb4cbaa88abbfcd4.json
Use formula patches accessor
Library/Homebrew/formula.rb
@@ -387,7 +387,7 @@ def require_universal_deps? def patch ohai "Patching" - active_spec.patches.each(&:apply) + patchlist.each(&:apply) end # yields self with current working directory set to the uncompressed tarball @@ -761,9 +761,9 @@ def prepare_patches active_spec.add_legacy_patches(patches) return if patchlist.empty? - active_spec.patches.grep(DATAPatch) { |p| p.path = path } + patchlist.grep(DATAPatch) { |p| p.path = path } - active_spec.patches.select(&:external?).each do |patch| + patchlist.select(&:external?).each do |patch| patch.verify_download_integrity(patch.fetch) end end
false
Other
Homebrew
brew
af1e9a9610f39480f8a476f4f960e111aa000ff4.json
Expose bottle details on the formula object Fixes Homebrew/homebrew#36032.
Library/Homebrew/cmd/test-bot.rb
@@ -365,7 +365,7 @@ def formula formula_name dependents -= @formulae dependents = dependents.map {|d| Formulary.factory(d)} - testable_dependents = dependents.select {|d| d.test_defined? && d.stable.bottled? } + testable_dependents = dependents.select { |d| d.test_defined? && d.bottled? } formula = Formulary.factory(formula_name) installed_gcc = false
true
Other
Homebrew
brew
af1e9a9610f39480f8a476f4f960e111aa000ff4.json
Expose bottle details on the formula object Fixes Homebrew/homebrew#36032.
Library/Homebrew/formula.rb
@@ -147,10 +147,20 @@ def head? active_spec == head end + # @private + def bottled? + active_spec.bottled? + end + + # @private + def bottle_specification + active_spec.bottle_specification + end + # The Bottle object for the currently active {SoftwareSpec}. # @private def bottle - Bottle.new(self, active_spec.bottle_specification) if active_spec.bottled? + Bottle.new(self, bottle_specification) if bottled? end # The homepage for the software.
true
Other
Homebrew
brew
af1e9a9610f39480f8a476f4f960e111aa000ff4.json
Expose bottle details on the formula object Fixes Homebrew/homebrew#36032.
Library/Homebrew/formula_versions.rb
@@ -78,7 +78,7 @@ def bottle_version_map(branch="HEAD") map = Hash.new { |h, k| h[k] = [] } rev_list(branch) do |rev| formula_at_revision(rev) do |f| - bottle = f.stable.bottle_specification + bottle = f.bottle_specification unless bottle.checksums.empty? map[f.pkg_version] << bottle.revision end
true
Other
Homebrew
brew
6a6b56127c0c25a8de51a305c6c94ad5bf11447b.json
test-bot: handle devel-only formulae.
Library/Homebrew/cmd/test-bot.rb
@@ -364,14 +364,24 @@ def formula formula_name dependents = `brew uses #{formula_name}`.split("\n") dependents -= @formulae dependents = dependents.map {|d| Formulary.factory(d)} + testable_dependents = dependents.select {|d| d.test_defined? && d.stable.bottled? } formula = Formulary.factory(formula_name) - return unless satisfied_requirements?(formula, :stable) - installed_gcc = false - deps = formula.stable.deps.to_a - reqs = formula.stable.requirements.to_a + + deps = [] + reqs = [] + + if formula.stable + return unless satisfied_requirements?(formula, :stable) + + deps |= formula.stable.deps.to_a + reqs |= formula.stable.requirements.to_a + elsif formula.devel + return unless satisfied_requirements?(formula, :devel) + end + if formula.devel && !ARGV.include?('--HEAD') deps |= formula.devel.deps.to_a reqs |= formula.devel.requirements.to_a
false
Other
Homebrew
brew
6d786e7dbbeb9c1c473ec80aabbf4a61ecaca1a1.json
brew-config: show realpath for pyenv and rbenv Closes Homebrew/homebrew#35819. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/config.rb
@@ -74,11 +74,21 @@ def describe_perl end def describe_python - describe_path(which 'python') + python = which 'python' + if %r{/shims/python$} =~ python && which('pyenv') + "#{python} => #{Pathname.new(`pyenv which python`.strip).realpath}" rescue describe_path(python) + else + describe_path(python) + end end def describe_ruby - describe_path(which 'ruby') + ruby = which 'ruby' + if %r{/shims/ruby$} =~ ruby && which('rbenv') + "#{ruby} => #{Pathname.new(`rbenv which ruby`.strip).realpath}" rescue describe_path(ruby) + else + describe_path(ruby) + end end def hardware
false
Other
Homebrew
brew
3f318b8ed4f33fa1f27f5ce1816ca72513196208.json
install: handle devel-only correctly See the discussion in https://github.com/Homebrew/homebrew-devel-only/pull/6 Closes Homebrew/homebrew#35793. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Library/Homebrew/cmd/install.rb
@@ -40,20 +40,32 @@ def install end ARGV.formulae.each do |f| - # Building head-only without --HEAD is an error - if not ARGV.build_head? and f.stable.nil? + # head-only without --HEAD is an error + if not ARGV.build_head? and f.stable.nil? and f.devel.nil? raise <<-EOS.undent #{f.name} is a head-only formula Install with `brew install --HEAD #{f.name}` EOS end - # Building stable-only with --HEAD is an error + # devel-only without --devel is an error + if not ARGV.build_devel? and f.stable.nil? + if f.head.nil? + raise <<-EOS.undent + #{f.name} is a devel-only formula + Install with `brew install --devel #{f.name}` + EOS + else + raise "#{f.name} has no stable download, please choose --devel or --HEAD" + end + end + + # --HEAD, fail with no head defined if ARGV.build_head? and f.head.nil? raise "No head is defined for #{f.name}" end - # Building stable-only with --devel is an error + # --devel, fail with no devel defined if ARGV.build_devel? and f.devel.nil? raise "No devel block is defined for #{f.name}" end
false
Other
Homebrew
brew
b109e4f1f1c39fb4d7ba49dc954c4de9ab3d286b.json
metafile: extend ext list Closes Homebrew/homebrew#35820. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Library/Homebrew/metafiles.rb
@@ -1,5 +1,9 @@ class Metafiles - EXTENSIONS = %w[.md .html .rtf .txt] + # https://github.com/github/markup#markups + EXTENSIONS = %w[ + .adoc .asc .asciidoc .creole .html .markdown .md .mdown .mediawiki .mkdn + .org .pod .rdoc .rst .rtf .textile .txt .wiki + ] BASENAMES = %w[ about authors changelog changes copying copyright history license licence news notes notice readme todo
false
Other
Homebrew
brew
4bdfb27d9fb4958a5845e598fd7b9c7cefab94e7.json
Move assertion setup into formula_assertions.rb
Library/Homebrew/cmd/test.rb
@@ -1,33 +1,11 @@ require "extend/ENV" require "timeout" require "debrew" +require "formula_assertions" module Homebrew TEST_TIMEOUT_SECONDS = 5*60 - if defined?(Gem) - begin - gem "minitest", "< 5.0.0" - rescue Gem::LoadError - require "test/unit/assertions" - else - require "minitest/unit" - require "test/unit/assertions" - end - else - require "test/unit/assertions" - end - - if defined?(MiniTest::Assertion) - FailedAssertion = MiniTest::Assertion - elsif defined?(Minitest::Assertion) - FailedAssertion = Minitest::Assertion - else - FailedAssertion = Test::Unit::AssertionFailedError - end - - require "formula_assertions" - def test raise FormulaUnspecifiedError if ARGV.named.empty? @@ -49,8 +27,7 @@ def test puts "Testing #{f.name}" - f.extend(Test::Unit::Assertions) - f.extend(Homebrew::Assertions) + f.extend(Assertions) f.extend(Debrew::Formula) if ARGV.debug? env = ENV.to_hash @@ -60,7 +37,7 @@ def test Timeout::timeout TEST_TIMEOUT_SECONDS do raise if f.run_test == false end - rescue FailedAssertion => e + rescue Assertions::FailedAssertion => e ofail "#{f.name}: failed" puts e.message rescue Exception => e
true
Other
Homebrew
brew
4bdfb27d9fb4958a5845e598fd7b9c7cefab94e7.json
Move assertion setup into formula_assertions.rb
Library/Homebrew/formula_assertions.rb
@@ -1,7 +1,26 @@ -require 'test/unit/assertions' - module Homebrew module Assertions + if defined?(Gem) + begin + gem "minitest", "< 5.0.0" + rescue Gem::LoadError + require "test/unit/assertions" + else + require "minitest/unit" + require "test/unit/assertions" + end + else + require "test/unit/assertions" + end + + if defined?(MiniTest::Assertion) + FailedAssertion = MiniTest::Assertion + elsif defined?(Minitest::Assertion) + FailedAssertion = Minitest::Assertion + else + FailedAssertion = Test::Unit::AssertionFailedError + end + include Test::Unit::Assertions # Returns the output of running cmd, and asserts the exit status
true
Other
Homebrew
brew
d298e54e50fdea57456385a6e6eaad6f3fc193b8.json
doctor: check access on HOMEBREW_PREFIX/opt
Library/Homebrew/cmd/doctor.rb
@@ -478,6 +478,16 @@ def check_access_cellar end end +def check_access_prefix_opt + opt = HOMEBREW_PREFIX.join("opt") + if opt.exist? && !opt.writable_real? + <<-EOS.undent + #{opt} isn't writable. + You should `chown` #{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
false
Other
Homebrew
brew
b1514c1c40390b2238f378ff132b76e2e8a744ef.json
doctor: check cellar access
Library/Homebrew/cmd/doctor.rb
@@ -469,6 +469,15 @@ def check_access_cache end end +def check_access_cellar + if HOMEBREW_CELLAR.exist? && !HOMEBREW_CELLAR.writable_real? + <<-EOS.undent + #{HOMEBREW_CELLAR} isn't writable. + You should `chown` #{HOMEBREW_CELLAR} + 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
false
Other
Homebrew
brew
7a49c143e4e44a280c7625404d8f84bab5677d88.json
Use attr_accessor for checksum
Library/Homebrew/resource.rb
@@ -8,9 +8,9 @@ class Resource include FileUtils - attr_reader :checksum, :mirrors, :specs, :using - attr_writer :checksum, :version - attr_accessor :download_strategy + attr_reader :mirrors, :specs, :using + attr_writer :version + attr_accessor :download_strategy, :checksum # Formula name must be set after the DSL, as we have no access to the # formula name before initialization of the formula
false
Other
Homebrew
brew
3f08b8881b9a7ddebbe3e4fcd2e036e7f2ea01d0.json
cleanup-installed: use uninstall --force.
Library/Homebrew/cmd/cleanup-installed.rb
@@ -15,6 +15,6 @@ def cleanup_installed current_formulae = `brew list`.lines.map(&:strip) uninstall_formulae = current_formulae - kept_formulae return if uninstall_formulae.empty? - safe_system "brew", "uninstall", *uninstall_formulae + safe_system "brew", "uninstall", "--force", *uninstall_formulae end end
false
Other
Homebrew
brew
26b80ecccca8db33fb067158634ac54630fec2d0.json
test-bot: improve output of dependent testing.
Library/Homebrew/cmd/test-bot.rb
@@ -365,9 +365,6 @@ def formula formula_name dependents -= @formulae dependents = dependents.map {|d| Formulary.factory(d)} testable_dependents = dependents.select {|d| d.test_defined? && d.stable.bottled? } - uninstalled_testable_dependents = testable_dependents.reject {|d| d.installed? } - testable_dependents.map! &:name - uninstalled_testable_dependents.map! &:name formula = Formulary.factory(formula_name) return unless satisfied_requirements?(formula, :stable) @@ -446,12 +443,16 @@ def formula formula_name end end test "brew", "test", "--verbose", formula_name if formula.test_defined? - if testable_dependents.any? - if uninstalled_testable_dependents.any? - test "brew", "fetch", *uninstalled_testable_dependents - test "brew", "install", *uninstalled_testable_dependents + testable_dependents.each do |dependent| + unless dependent.installed? + test "brew", "fetch", "--retry", dependent.name + next if steps.last.failed? + test "brew", "install", dependent.name + next if steps.last.failed? + end + if dependent.installed? + test "brew", "test", "--verbose", dependent.name end - test "brew", "test", *testable_dependents end test "brew", "uninstall", "--force", formula_name end
false
Other
Homebrew
brew
424ded8fdb9e3e71851a5f8678bfab5a2c3d76c7.json
test-bot: ignore changed dependents.
Library/Homebrew/cmd/test-bot.rb
@@ -362,6 +362,7 @@ def formula formula_name changed_dependences = dependencies - unchanged_dependencies dependents = `brew uses #{formula_name}`.split("\n") + dependents -= @formulae dependents = dependents.map {|d| Formulary.factory(d)} testable_dependents = dependents.select {|d| d.test_defined? && d.stable.bottled? } uninstalled_testable_dependents = testable_dependents.reject {|d| d.installed? }
false
Other
Homebrew
brew
459f92b065546ebef244f101636c49aca9bc4b2b.json
Remove another use of the direct url writer masgn is hard to grep for :/
Library/Homebrew/cmd/create.rb
@@ -109,7 +109,9 @@ def generate! if fetch? && version r = Resource.new - r.url, r.version, r.owner = url, version, self + r.url(url) + r.version(version) + r.owner = self @sha1 = r.fetch.sha1 if r.download_strategy == CurlDownloadStrategy end
false
Other
Homebrew
brew
0f01e9ff43c1576bc91741732ca961ee3d7e0545.json
Remove the direct url writer from Resource
Library/Homebrew/patch.rb
@@ -161,7 +161,7 @@ def inspect class LegacyPatch < ExternalPatch def initialize(strip, url) super(strip) - resource.url = url + resource.url(url) resource.download_strategy = CurlDownloadStrategy end
true
Other
Homebrew
brew
0f01e9ff43c1576bc91741732ca961ee3d7e0545.json
Remove the direct url writer from Resource
Library/Homebrew/resource.rb
@@ -9,7 +9,7 @@ class Resource include FileUtils attr_reader :checksum, :mirrors, :specs, :using - attr_writer :url, :checksum, :version + attr_writer :checksum, :version attr_accessor :download_strategy # Formula name must be set after the DSL, as we have no access to the
true
Other
Homebrew
brew
0f01e9ff43c1576bc91741732ca961ee3d7e0545.json
Remove the direct url writer from Resource
Library/Homebrew/software_spec.rb
@@ -224,7 +224,7 @@ def initialize(formula, spec) checksum, tag = spec.checksum_for(bottle_tag) filename = Filename.create(formula, tag, spec.revision) - @resource.url = build_url(spec.root_url, filename) + @resource.url(build_url(spec.root_url, filename)) @resource.download_strategy = CurlBottleDownloadStrategy @resource.version = formula.pkg_version @resource.checksum = checksum
true