From 846a5b79b6868d6f78a1b46baedae89d74bb5142 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 22 Sep 2016 14:36:24 -0400 Subject: Remove old cctools references now that only ruby-macho is used. --- Library/Homebrew/dev-cmd/bottle.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/dev-cmd/bottle.rb') diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 9676e374c..f4d6a463a 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -255,7 +255,7 @@ module Homebrew if prefix != prefix_check relocatable = false if keg_contain_absolute_symlink_starting_with?(prefix, keg) end - skip_relocation = relocatable && !keg.require_install_name_tool? + skip_relocation = relocatable && !keg.require_relocation? end puts if !relocatable && ARGV.verbose? rescue Interrupt -- cgit v1.2.3 From 240e49052cf113b74c0b2940531d7b6a28ab83af Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 21 Sep 2016 08:49:04 +0200 Subject: Fix Performance/FixedSize. --- Library/Homebrew/dev-cmd/bottle.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/dev-cmd/bottle.rb') diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index f4d6a463a..fe07526f3 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -436,7 +436,7 @@ module Homebrew puts output update_or_add = "add" if s.include? "stable do" - indent = s.slice(/^ +stable do/).length - "stable do".length + indent = s.slice(/^( +)stable do/, 1).length string = s.sub!(/^ {#{indent}}stable do(.|\n)+?^ {#{indent}}end\n/m, '\0' + output + "\n") else string = s.sub!( -- cgit v1.2.3 From a5b11a6a5c7e29b9040f93fd211f52479507dd01 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 22 Sep 2016 20:12:28 +0200 Subject: Fix Style/GuardClause. --- Library/Homebrew/dev-cmd/bottle.rb | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'Library/Homebrew/dev-cmd/bottle.rb') diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index fe07526f3..797828e0e 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -51,10 +51,11 @@ module Homebrew end @put_filenames ||= [] - unless @put_filenames.include? filename - puts "#{Tty.red}#{filename}#{Tty.reset}" - @put_filenames << filename - end + + return if @put_filenames.include? filename + + puts "#{Tty.red}#{filename}#{Tty.reset}" + @put_filenames << filename end result = false @@ -137,11 +138,11 @@ module Homebrew tap = f.tap unless tap - if ARGV.include?("--force-core-tap") - tap = CoreTap.instance - else + unless ARGV.include?("--force-core-tap") return ofail "Formula not from core or any taps: #{f.full_name}" end + + tap = CoreTap.instance end if f.bottle_disabled? @@ -323,34 +324,33 @@ module Homebrew puts "./#{filename}" puts output - if ARGV.include? "--json" - json = { - f.full_name => { - "formula" => { - "pkg_version" => f.pkg_version.to_s, - "path" => f.path.to_s.strip_prefix("#{HOMEBREW_REPOSITORY}/"), - }, - "bottle" => { - "root_url" => bottle.root_url, - "prefix" => bottle.prefix, - "cellar" => bottle.cellar.to_s, - "rebuild" => bottle.rebuild, - "tags" => { - Utils::Bottles.tag.to_s => { - "filename" => filename.to_s, - "sha256" => sha256, - }, + return unless ARGV.include? "--json" + json = { + f.full_name => { + "formula" => { + "pkg_version" => f.pkg_version.to_s, + "path" => f.path.to_s.strip_prefix("#{HOMEBREW_REPOSITORY}/"), + }, + "bottle" => { + "root_url" => bottle.root_url, + "prefix" => bottle.prefix, + "cellar" => bottle.cellar.to_s, + "rebuild" => bottle.rebuild, + "tags" => { + Utils::Bottles.tag.to_s => { + "filename" => filename.to_s, + "sha256" => sha256, }, }, - "bintray" => { - "package" => Utils::Bottles::Bintray.package(f.name), - "repository" => Utils::Bottles::Bintray.repository(tap), - }, }, - } - File.open("#{filename.prefix}.bottle.json", "w") do |file| - file.write Utils::JSON.dump json - end + "bintray" => { + "package" => Utils::Bottles::Bintray.package(f.name), + "repository" => Utils::Bottles::Bintray.repository(tap), + }, + }, + } + File.open("#{filename.prefix}.bottle.json", "w") do |file| + file.write Utils::JSON.dump json end end -- cgit v1.2.3 From fe2d51e0b9d4d9c138e512c245b1ed8d0f1dbf53 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 23 Sep 2016 11:01:40 +0200 Subject: Fix Style/IfUnlessModifier. --- Library/Homebrew/dev-cmd/bottle.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Library/Homebrew/dev-cmd/bottle.rb') diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 797828e0e..b2aa3b2c5 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -108,9 +108,7 @@ module Homebrew absolute_symlinks_start_with_string = [] keg.find do |pn| next unless pn.symlink? && (link = pn.readlink).absolute? - if link.to_s.start_with?(string) - absolute_symlinks_start_with_string << pn - end + absolute_symlinks_start_with_string << pn if link.to_s.start_with?(string) end if ARGV.verbose? @@ -155,9 +153,7 @@ module Homebrew return ofail "Formula not installed with '--build-bottle': #{f.full_name}" end - unless f.stable - return ofail "Formula has no stable version: #{f.full_name}" - end + return ofail "Formula has no stable version: #{f.full_name}" unless f.stable if ARGV.include?("--no-rebuild") || !f.tap rebuild = 0 -- cgit v1.2.3