diff --git a/internal/pipe/brew/brew.go b/internal/pipe/brew/brew.go index 644b55ba8..6a5b9c5ce 100644 --- a/internal/pipe/brew/brew.go +++ b/internal/pipe/brew/brew.go @@ -199,26 +199,8 @@ func buildFormula(ctx *context.Context, brew config.Homebrew, client client.Clie } func fixDataDownloads(data templateData) templateData { - if data.MacOSAmd64.DownloadURL != "" { - data.HasMacOSDownloads = true - data.MacOSArches = append(data.MacOSArches, ":x86_64") - } - if data.MacOSArm64.DownloadURL != "" { - data.HasMacOSDownloads = true - data.MacOSArches = append(data.MacOSArches, ":aarch64") - } - if data.LinuxAmd64.DownloadURL != "" { - data.HasLinuxDownloads = true - data.LinuxArches = append(data.LinuxArches, ":x86_64") - } - if data.LinuxArm64.DownloadURL != "" { - data.HasLinuxDownloads = true - data.LinuxArches = append(data.LinuxArches, ":aarch64") - } - if data.LinuxArm.DownloadURL != "" { - data.HasLinuxDownloads = true - data.LinuxArches = append(data.LinuxArches, ":arm") - } + data.HasMacOSDownloads = data.MacOSAmd64.DownloadURL != "" || data.MacOSArm64.DownloadURL != "" + data.HasLinuxDownloads = data.LinuxAmd64.DownloadURL != "" || data.LinuxArm64.DownloadURL != "" || data.LinuxArm.DownloadURL != "" return data } diff --git a/internal/pipe/brew/template.go b/internal/pipe/brew/template.go index cba2ead62..0cb28c03b 100644 --- a/internal/pipe/brew/template.go +++ b/internal/pipe/brew/template.go @@ -25,8 +25,6 @@ type templateData struct { LinuxArm64 downloadable HasMacOSDownloads bool HasLinuxDownloads bool - MacOSArches []string - LinuxArches []string } type downloadable struct { @@ -73,8 +71,6 @@ class {{ .Name }} < Formula sha256 "{{ .MacOSArm64.SHA256 }}" end {{- end }} - - depends_on arch: [{{ join .MacOSArches ", " }}] end {{- end }} @@ -103,8 +99,6 @@ class {{ .Name }} < Formula sha256 "{{ .LinuxArm64.SHA256 }}" end {{- end }} - - depends_on arch: [{{ join .LinuxArches ", " }}] end {{- end }} diff --git a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden index 86d50dd17..f7812f040 100644 --- a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden +++ b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden @@ -18,8 +18,6 @@ class Test < Formula url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz" sha256 "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd" end - - depends_on arch: [:x86_64, :aarch64] end on_linux do @@ -35,8 +33,6 @@ class Test < Formula url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm64.tar.gz" sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67" end - - depends_on arch: [:x86_64, :aarch64, :arm] end devel do diff --git a/internal/pipe/brew/testdata/TestFullFormulaeLinuxOnly.rb.golden b/internal/pipe/brew/testdata/TestFullFormulaeLinuxOnly.rb.golden index 0ac23ddb6..9a03b6fd8 100644 --- a/internal/pipe/brew/testdata/TestFullFormulaeLinuxOnly.rb.golden +++ b/internal/pipe/brew/testdata/TestFullFormulaeLinuxOnly.rb.golden @@ -22,8 +22,6 @@ class Test < Formula url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm64.tar.gz" sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67" end - - depends_on arch: [:x86_64, :aarch64, :arm] end def install diff --git a/internal/pipe/brew/testdata/TestRunPipe/custom_block.rb.golden b/internal/pipe/brew/testdata/TestRunPipe/custom_block.rb.golden index ab90b2127..d9a3e5f2b 100644 --- a/internal/pipe/brew/testdata/TestRunPipe/custom_block.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipe/custom_block.rb.golden @@ -14,8 +14,6 @@ class CustomBlock < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end head "https://github.com/caarlos0/test.git" diff --git a/internal/pipe/brew/testdata/TestRunPipe/custom_download_strategy.rb.golden b/internal/pipe/brew/testdata/TestRunPipe/custom_download_strategy.rb.golden index 6b253c86d..7b3e80d59 100644 --- a/internal/pipe/brew/testdata/TestRunPipe/custom_download_strategy.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipe/custom_download_strategy.rb.golden @@ -14,8 +14,6 @@ class CustomDownloadStrategy < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end depends_on "zsh" => :optional diff --git a/internal/pipe/brew/testdata/TestRunPipe/custom_require.rb.golden b/internal/pipe/brew/testdata/TestRunPipe/custom_require.rb.golden index bb45ecbda..87a2679fa 100644 --- a/internal/pipe/brew/testdata/TestRunPipe/custom_require.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipe/custom_require.rb.golden @@ -15,8 +15,6 @@ class CustomRequire < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => CustomDownloadStrategy sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end depends_on "zsh" => :optional diff --git a/internal/pipe/brew/testdata/TestRunPipe/default.rb.golden b/internal/pipe/brew/testdata/TestRunPipe/default.rb.golden index 33b957130..ac4cd99e6 100644 --- a/internal/pipe/brew/testdata/TestRunPipe/default.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipe/default.rb.golden @@ -14,8 +14,6 @@ class Default < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end depends_on "zsh" => :optional diff --git a/internal/pipe/brew/testdata/TestRunPipe/default_gitlab.rb.golden b/internal/pipe/brew/testdata/TestRunPipe/default_gitlab.rb.golden index 43f77f4fa..56d22d51e 100644 --- a/internal/pipe/brew/testdata/TestRunPipe/default_gitlab.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipe/default_gitlab.rb.golden @@ -14,8 +14,6 @@ class DefaultGitlab < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end depends_on "zsh" => :optional diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden index 5887c79f3..cdd0d2e9b 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden @@ -13,8 +13,6 @@ class MultipleArmv5 < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end on_linux do @@ -26,8 +24,6 @@ class MultipleArmv5 < Formula url "https://dummyhost/download/v1.0.1/arm64.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:aarch64, :arm] end depends_on "zsh" diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden index 62f3be058..40f06a96e 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden @@ -13,8 +13,6 @@ class MultipleArmv6 < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end on_linux do @@ -26,8 +24,6 @@ class MultipleArmv6 < Formula url "https://dummyhost/download/v1.0.1/arm64.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:aarch64, :arm] end depends_on "zsh" diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden index 86761d01a..97e11f660 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden @@ -13,8 +13,6 @@ class MultipleArmv7 < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end on_linux do @@ -26,8 +24,6 @@ class MultipleArmv7 < Formula url "https://dummyhost/download/v1.0.1/arm64.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:aarch64, :arm] end depends_on "zsh" diff --git a/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden b/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden index 3bd698547..95a4b22eb 100644 --- a/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden @@ -14,8 +14,6 @@ class FooIsBar < Formula url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end - - depends_on arch: [:x86_64] end def install