Skip to content

Commit

Permalink
Merge pull request Homebrew#14421 from hyuraku/move_check_binary_arch…
Browse files Browse the repository at this point in the history
…es-to-extend-os

move `check_binary_arches` to `extend/os`
  • Loading branch information
MikeMcQuaid authored Jan 26, 2023
2 parents 7e77b89 + 420d665 commit 1c85a71
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Library/Homebrew/extend/os/keg.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# typed: strict
# frozen_string_literal: true

require "extend/os/mac/keg" if OS.mac?
if OS.mac?
require "extend/os/mac/keg"
elsif OS.linux?
require "extend/os/linux/keg"
end
10 changes: 10 additions & 0 deletions Library/Homebrew/extend/os/linux/keg.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# typed: false
# frozen_string_literal: true

class Keg
undef binary_executable_or_library_files

def binary_executable_or_library_files
elf_files
end
end
3 changes: 0 additions & 3 deletions Library/Homebrew/formula_cellar_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ def check_cpuid_instruction(formula)

def check_binary_arches(formula)
return unless formula.prefix.directory?
# There is no `binary_executable_or_library_files` method for the generic OS
# TODO: Refactor and move to extend/os
return if !OS.mac? && !OS.linux? # rubocop:disable Homebrew/MoveToExtendOS

keg = Keg.new(formula.prefix)
mismatches = {}
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def delete_pyc_files!
end

def binary_executable_or_library_files
elf_files
[]
end

def codesign_patched_binary(file); end
Expand Down

0 comments on commit 1c85a71

Please sign in to comment.