From 4025dce0971ccf655c8889c099e0b8a5dbe5a4ba Mon Sep 17 00:00:00 2001 From: Chris Wegrzyn Date: Tue, 27 Apr 2021 09:15:53 -0400 Subject: [PATCH 1/7] Support adding root_url specs in bottle output --- Library/Homebrew/dev-cmd/bottle.rb | 15 ++++++++++----- Library/Homebrew/dev-cmd/pr-pull.rb | 3 +++ Library/Homebrew/dev-cmd/pr-upload.rb | 3 +++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 1cc5b84a23..7361b9dade 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -16,7 +16,9 @@ BOTTLE_ERB = <<-EOS bottle do <% if [HOMEBREW_BOTTLE_DEFAULT_DOMAIN.to_s, "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}/bottles"].exclude?(root_url) %> - root_url "<%= root_url %>" + root_url "<%= root_url %>"<% unless root_url_specs.blank? %>, + <%= root_url_specs %> + <% end %> <% end %> <% if rebuild.positive? %> rebuild <%= rebuild %> @@ -75,6 +77,8 @@ module Homebrew description: "Specify a committer name and email in `git`'s standard author format." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." + flag "--root-url-specs=", + description: "Append the specified specs to the root_url line in the generated DSL" conflicts "--no-rebuild", "--keep-old" @@ -221,7 +225,7 @@ module Homebrew %Q(#{line}"#{digest}") end - def bottle_output(bottle) + def bottle_output(bottle, root_url_specs) cellars = bottle.checksums.map do |checksum| cellar = checksum["cellar"] next unless cellar_parameter_needed? cellar @@ -244,6 +248,7 @@ module Homebrew end erb_binding = bottle.instance_eval { binding } erb_binding.local_variable_set(:sha256_lines, sha256_lines) + erb_binding.local_variable_set(:root_url_specs, root_url_specs) erb = ERB.new BOTTLE_ERB erb.result(erb_binding).gsub(/^\s*$\n/, "") end @@ -529,7 +534,7 @@ module Homebrew end end - output = bottle_output bottle + output = bottle_output(bottle, args.root_url_specs) puts "./#{local_filename}" puts output @@ -641,7 +646,7 @@ module Homebrew end unless args.write? - puts bottle_output(bottle) + puts bottle_output(bottle, args.root_url_specs) next end @@ -720,7 +725,7 @@ module Homebrew update_or_add = checksums.nil? ? "add" : "update" checksums&.each(&bottle.method(:sha256)) - output = bottle_output(bottle) + output = bottle_output(bottle, args.root_url_specs) puts output case update_or_add diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index e55e2afa31..17bce82c4c 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -61,6 +61,8 @@ module Homebrew description: "Target tap repository (default: `homebrew/core`)." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." + flag "--root-url-specs=", + description: "Append the specified specs to the root_url line in the generated DSL" flag "--bintray-mirror=", description: "Use the specified Bintray repository to automatically mirror stable URLs "\ "defined in the formulae (default: `mirror`)." @@ -443,6 +445,7 @@ module Homebrew upload_args << "--warn-on-upload-failure" if args.warn_on_upload_failure? upload_args << "--committer=#{args.committer}" if args.committer upload_args << "--root-url=#{args.root_url}" if args.root_url + upload_args << "--root-url-specs=#{args.root_url_specs}" if args.root_url_specs upload_args << if archive_item.present? "--archive-item=#{archive_item}" else diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index e21b98d9dd..bad0f18f5f 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -40,6 +40,8 @@ module Homebrew description: "Upload to the specified GitHub organisation's GitHub Packages (default: `homebrew`)." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." + flag "--root-url-specs=", + description: "Append the specified specs to the root_url line in the generated DSL" named_args :none end @@ -114,6 +116,7 @@ module Homebrew bottle_args << "--root-url=#{args.root_url}" if args.root_url bottle_args << "--committer=#{args.committer}" if args.committer bottle_args << "--no-commit" if args.no_commit? + bottle_args << "--root-url-specs=#{args.root_url_specs}" if args.root_url_specs bottle_args += json_files if args.dry_run? From 02987c2649897d625291c73706a596f9996f18e9 Mon Sep 17 00:00:00 2001 From: Chris Wegrzyn Date: Tue, 27 Apr 2021 09:47:36 -0400 Subject: [PATCH 2/7] Add test --- Library/Homebrew/test/dev-cmd/bottle_spec.rb | 86 +++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index c794479803..5aa4790ec9 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -396,6 +396,90 @@ describe "brew bottle" do + # something here + + end + EOS + end + end + + describe "--merge with --root-url-specs", :integration_test do + let(:core_tap) { CoreTap.new } + let(:tarball) do + if OS.linux? + TEST_FIXTURE_DIR/"tarballs/testball-0.1-linux.tbz" + else + TEST_FIXTURE_DIR/"tarballs/testball-0.1.tbz" + end + end + + before do + Pathname("#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json").write stub_hash( + name: "testball", + version: "1.0", + path: "#{core_tap.path}/Formula/testball.rb", + cellar: "any_skip_relocation", + os: "arm64_big_sur", + filename: "testball-1.0.arm64_big_sur.bottle.tar.gz", + local_filename: "testball--1.0.arm64_big_sur.bottle.tar.gz", + root_url: "https://example.com/", + sha256: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149", + ) + end + + after do + FileUtils.rm_f "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json" + end + + it "adds a formula block with a custom root_url spec" do + core_tap.path.cd do + system "git", "init" + setup_test_formula "testball" + system "git", "add", "--all" + system "git", "commit", "-m", "testball 0.1" + end + + expect { + brew "bottle", + "--merge", + "--write", + "--root-url-specs=using: MyCustomStrategy", + "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json" + }.to output(<<~EOS).to_stdout + ==> testball + bottle do + root_url "https://example.com/", + using: MyCustomStrategy + sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149" + end + EOS + + expect((core_tap.path/"Formula/testball.rb").read).to eq <<~EOS + class Testball < Formula + desc "Some test" + homepage "https://brew.sh/testball" + url "file://#{tarball}" + sha256 "#{tarball.sha256}" + + bottle do + root_url "https://example.com/", + using: MyCustomStrategy + sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149" + end + + option "with-foo", "Build with foo" + + def install + (prefix/"foo"/"test").write("test") if build.with? "foo" + prefix.install Dir["*"] + (buildpath/"test.c").write \ + "#include \\nint main(){printf(\\"test\\");return 0;}" + bin.mkpath + system ENV.cc, "test.c", "-o", bin/"test" + end + + + # something here end @@ -636,7 +720,7 @@ def stub_hash(parameters) "path":"#{parameters[:path]}" }, "bottle":{ - "root_url":"#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}", + "root_url":"#{parameters[:root_url] || HOMEBREW_BOTTLE_DEFAULT_DOMAIN}", "prefix":"/usr/local", "cellar":"#{parameters[:cellar]}", "rebuild":0, From 3f60c954256d604d6897ca7fc25ae906b99569d4 Mon Sep 17 00:00:00 2001 From: Chris Wegrzyn Date: Wed, 28 Apr 2021 12:00:14 -0400 Subject: [PATCH 3/7] --download-strategy instead of --root-url-spec --- Library/Homebrew/dev-cmd/bottle.rb | 18 +-- Library/Homebrew/dev-cmd/pr-pull.rb | 6 +- Library/Homebrew/dev-cmd/pr-upload.rb | 6 +- Library/Homebrew/test/dev-cmd/bottle_spec.rb | 117 ++++++------------- 4 files changed, 48 insertions(+), 99 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 7361b9dade..d295b8998d 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -16,8 +16,8 @@ BOTTLE_ERB = <<-EOS bottle do <% if [HOMEBREW_BOTTLE_DEFAULT_DOMAIN.to_s, "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}/bottles"].exclude?(root_url) %> - root_url "<%= root_url %>"<% unless root_url_specs.blank? %>, - <%= root_url_specs %> + root_url "<%= root_url %>"<% unless download_strategy.blank? %>, + using: <%= download_strategy %> <% end %> <% end %> <% if rebuild.positive? %> @@ -77,8 +77,8 @@ module Homebrew description: "Specify a committer name and email in `git`'s standard author format." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." - flag "--root-url-specs=", - description: "Append the specified specs to the root_url line in the generated DSL" + flag "--download-strategy=", + description: "Use the specified download strategy for the root_url in the generated DSL" conflicts "--no-rebuild", "--keep-old" @@ -225,7 +225,7 @@ module Homebrew %Q(#{line}"#{digest}") end - def bottle_output(bottle, root_url_specs) + def bottle_output(bottle, download_strategy) cellars = bottle.checksums.map do |checksum| cellar = checksum["cellar"] next unless cellar_parameter_needed? cellar @@ -248,7 +248,7 @@ module Homebrew end erb_binding = bottle.instance_eval { binding } erb_binding.local_variable_set(:sha256_lines, sha256_lines) - erb_binding.local_variable_set(:root_url_specs, root_url_specs) + erb_binding.local_variable_set(:download_strategy, download_strategy) erb = ERB.new BOTTLE_ERB erb.result(erb_binding).gsub(/^\s*$\n/, "") end @@ -534,7 +534,7 @@ module Homebrew end end - output = bottle_output(bottle, args.root_url_specs) + output = bottle_output(bottle, args.download_strategy) puts "./#{local_filename}" puts output @@ -646,7 +646,7 @@ module Homebrew end unless args.write? - puts bottle_output(bottle, args.root_url_specs) + puts bottle_output(bottle, args.download_strategy) next end @@ -725,7 +725,7 @@ module Homebrew update_or_add = checksums.nil? ? "add" : "update" checksums&.each(&bottle.method(:sha256)) - output = bottle_output(bottle, args.root_url_specs) + output = bottle_output(bottle, args.download_strategy) puts output case update_or_add diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 17bce82c4c..e6723222eb 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -61,8 +61,8 @@ module Homebrew description: "Target tap repository (default: `homebrew/core`)." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." - flag "--root-url-specs=", - description: "Append the specified specs to the root_url line in the generated DSL" + flag "--download-strategy=", + description: "Use the specified download strategy for the root_url in the generated DSL" flag "--bintray-mirror=", description: "Use the specified Bintray repository to automatically mirror stable URLs "\ "defined in the formulae (default: `mirror`)." @@ -445,7 +445,7 @@ module Homebrew upload_args << "--warn-on-upload-failure" if args.warn_on_upload_failure? upload_args << "--committer=#{args.committer}" if args.committer upload_args << "--root-url=#{args.root_url}" if args.root_url - upload_args << "--root-url-specs=#{args.root_url_specs}" if args.root_url_specs + upload_args << "--download-strategy=#{args.download_strategy}" if args.download_strategy upload_args << if archive_item.present? "--archive-item=#{archive_item}" else diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index bad0f18f5f..d4f55178f2 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -40,8 +40,8 @@ module Homebrew description: "Upload to the specified GitHub organisation's GitHub Packages (default: `homebrew`)." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." - flag "--root-url-specs=", - description: "Append the specified specs to the root_url line in the generated DSL" + flag "--download-strategy=", + description: "Use the specified download strategy for the root_url in the generated DSL" named_args :none end @@ -116,7 +116,7 @@ module Homebrew bottle_args << "--root-url=#{args.root_url}" if args.root_url bottle_args << "--committer=#{args.committer}" if args.committer bottle_args << "--no-commit" if args.no_commit? - bottle_args << "--root-url-specs=#{args.root_url_specs}" if args.root_url_specs + bottle_args << "--download-strategy=#{args.download_strategy}" if args.download_strategy bottle_args += json_files if args.dry_run? diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index 5aa4790ec9..3564901578 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -396,90 +396,6 @@ describe "brew bottle" do - # something here - - end - EOS - end - end - - describe "--merge with --root-url-specs", :integration_test do - let(:core_tap) { CoreTap.new } - let(:tarball) do - if OS.linux? - TEST_FIXTURE_DIR/"tarballs/testball-0.1-linux.tbz" - else - TEST_FIXTURE_DIR/"tarballs/testball-0.1.tbz" - end - end - - before do - Pathname("#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json").write stub_hash( - name: "testball", - version: "1.0", - path: "#{core_tap.path}/Formula/testball.rb", - cellar: "any_skip_relocation", - os: "arm64_big_sur", - filename: "testball-1.0.arm64_big_sur.bottle.tar.gz", - local_filename: "testball--1.0.arm64_big_sur.bottle.tar.gz", - root_url: "https://example.com/", - sha256: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149", - ) - end - - after do - FileUtils.rm_f "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json" - end - - it "adds a formula block with a custom root_url spec" do - core_tap.path.cd do - system "git", "init" - setup_test_formula "testball" - system "git", "add", "--all" - system "git", "commit", "-m", "testball 0.1" - end - - expect { - brew "bottle", - "--merge", - "--write", - "--root-url-specs=using: MyCustomStrategy", - "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json" - }.to output(<<~EOS).to_stdout - ==> testball - bottle do - root_url "https://example.com/", - using: MyCustomStrategy - sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149" - end - EOS - - expect((core_tap.path/"Formula/testball.rb").read).to eq <<~EOS - class Testball < Formula - desc "Some test" - homepage "https://brew.sh/testball" - url "file://#{tarball}" - sha256 "#{tarball.sha256}" - - bottle do - root_url "https://example.com/", - using: MyCustomStrategy - sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149" - end - - option "with-foo", "Build with foo" - - def install - (prefix/"foo"/"test").write("test") if build.with? "foo" - prefix.install Dir["*"] - (buildpath/"test.c").write \ - "#include \\nint main(){printf(\\"test\\");return 0;}" - bin.mkpath - system ENV.cc, "test.c", "-o", bin/"test" - end - - - # something here end @@ -708,6 +624,39 @@ describe "brew bottle" do end end end + + describe "::bottle_output" do + it "includes a custom root_url" do + bottle = BottleSpecification.new + bottle.root_url("https://example.com") + bottle.sha256(catalina: "109c0cb581a7b5d84da36d84b221fb9dd0f8a927b3044d82611791c9907e202e") + + expect(homebrew.bottle_output(bottle, nil)).to eq( + <<~RUBY.indent(2), + bottle do + root_url "https://example.com" + sha256 catalina: "109c0cb581a7b5d84da36d84b221fb9dd0f8a927b3044d82611791c9907e202e" + end + RUBY + ) + end + + it "includes download strategy for custom root_url" do + bottle = BottleSpecification.new + bottle.root_url("https://example.com") + bottle.sha256(catalina: "109c0cb581a7b5d84da36d84b221fb9dd0f8a927b3044d82611791c9907e202e") + + expect(homebrew.bottle_output(bottle, "ExampleStrategy")).to eq( + <<~RUBY.indent(2), + bottle do + root_url "https://example.com", + using: ExampleStrategy + sha256 catalina: "109c0cb581a7b5d84da36d84b221fb9dd0f8a927b3044d82611791c9907e202e" + end + RUBY + ) + end + end end end From 76607bbb6fae52fcd32cda339c22121c3e0a23ec Mon Sep 17 00:00:00 2001 From: Chris Wegrzyn Date: Wed, 28 Apr 2021 14:49:26 -0400 Subject: [PATCH 4/7] Simplify conditional as suggested Co-authored-by: Mike McQuaid --- Library/Homebrew/dev-cmd/bottle.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index d295b8998d..881d1859ac 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -16,7 +16,7 @@ BOTTLE_ERB = <<-EOS bottle do <% if [HOMEBREW_BOTTLE_DEFAULT_DOMAIN.to_s, "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}/bottles"].exclude?(root_url) %> - root_url "<%= root_url %>"<% unless download_strategy.blank? %>, + root_url "<%= root_url %>"<% if download_strategy.present? %>, using: <%= download_strategy %> <% end %> <% end %> From ffbabfd2380713f15579e8830249ec4aea12e180 Mon Sep 17 00:00:00 2001 From: Chris Wegrzyn Date: Wed, 28 Apr 2021 14:57:41 -0400 Subject: [PATCH 5/7] Rename download-strategy to root-url-using --- Library/Homebrew/dev-cmd/bottle.rb | 18 +++++++++--------- Library/Homebrew/dev-cmd/pr-pull.rb | 6 +++--- Library/Homebrew/dev-cmd/pr-upload.rb | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 881d1859ac..74e6d140a6 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -16,8 +16,8 @@ BOTTLE_ERB = <<-EOS bottle do <% if [HOMEBREW_BOTTLE_DEFAULT_DOMAIN.to_s, "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}/bottles"].exclude?(root_url) %> - root_url "<%= root_url %>"<% if download_strategy.present? %>, - using: <%= download_strategy %> + root_url "<%= root_url %>"<% if root_url_using.present? %>, + using: <%= root_url_using %> <% end %> <% end %> <% if rebuild.positive? %> @@ -77,8 +77,8 @@ module Homebrew description: "Specify a committer name and email in `git`'s standard author format." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." - flag "--download-strategy=", - description: "Use the specified download strategy for the root_url in the generated DSL" + flag "--root-url-using=", + description: "Use the specified download strategy for the root_url in the generated DSL via `using:' arg" conflicts "--no-rebuild", "--keep-old" @@ -225,7 +225,7 @@ module Homebrew %Q(#{line}"#{digest}") end - def bottle_output(bottle, download_strategy) + def bottle_output(bottle, root_url_using) cellars = bottle.checksums.map do |checksum| cellar = checksum["cellar"] next unless cellar_parameter_needed? cellar @@ -248,7 +248,7 @@ module Homebrew end erb_binding = bottle.instance_eval { binding } erb_binding.local_variable_set(:sha256_lines, sha256_lines) - erb_binding.local_variable_set(:download_strategy, download_strategy) + erb_binding.local_variable_set(:root_url_using, root_url_using) erb = ERB.new BOTTLE_ERB erb.result(erb_binding).gsub(/^\s*$\n/, "") end @@ -534,7 +534,7 @@ module Homebrew end end - output = bottle_output(bottle, args.download_strategy) + output = bottle_output(bottle, args.root_url_using) puts "./#{local_filename}" puts output @@ -646,7 +646,7 @@ module Homebrew end unless args.write? - puts bottle_output(bottle, args.download_strategy) + puts bottle_output(bottle, args.root_url_using) next end @@ -725,7 +725,7 @@ module Homebrew update_or_add = checksums.nil? ? "add" : "update" checksums&.each(&bottle.method(:sha256)) - output = bottle_output(bottle, args.download_strategy) + output = bottle_output(bottle, args.root_url_using) puts output case update_or_add diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index e6723222eb..521eb0e229 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -61,8 +61,8 @@ module Homebrew description: "Target tap repository (default: `homebrew/core`)." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." - flag "--download-strategy=", - description: "Use the specified download strategy for the root_url in the generated DSL" + flag "--root-url-using=", + description: "Use the specified download strategy for the root_url in the generated DSL via `using:' arg" flag "--bintray-mirror=", description: "Use the specified Bintray repository to automatically mirror stable URLs "\ "defined in the formulae (default: `mirror`)." @@ -445,7 +445,7 @@ module Homebrew upload_args << "--warn-on-upload-failure" if args.warn_on_upload_failure? upload_args << "--committer=#{args.committer}" if args.committer upload_args << "--root-url=#{args.root_url}" if args.root_url - upload_args << "--download-strategy=#{args.download_strategy}" if args.download_strategy + upload_args << "--root-url-using=#{args.root_url_using}" if args.root_url_using upload_args << if archive_item.present? "--archive-item=#{archive_item}" else diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index d4f55178f2..a446141008 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -40,8 +40,8 @@ module Homebrew description: "Upload to the specified GitHub organisation's GitHub Packages (default: `homebrew`)." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." - flag "--download-strategy=", - description: "Use the specified download strategy for the root_url in the generated DSL" + flag "--root-url-using=", + description: "Use the specified download strategy for the root_url in the generated DSL via `using:' arg" named_args :none end @@ -116,7 +116,7 @@ module Homebrew bottle_args << "--root-url=#{args.root_url}" if args.root_url bottle_args << "--committer=#{args.committer}" if args.committer bottle_args << "--no-commit" if args.no_commit? - bottle_args << "--download-strategy=#{args.download_strategy}" if args.download_strategy + bottle_args << "--root-url-using=#{args.root_url_using}" if args.root_url_using bottle_args += json_files if args.dry_run? From ee8dc058d811cce26bbb89d12e5e9504947bc0e1 Mon Sep 17 00:00:00 2001 From: Chris Wegrzyn Date: Thu, 29 Apr 2021 10:13:53 -0400 Subject: [PATCH 6/7] Better help text --- Library/Homebrew/dev-cmd/bottle.rb | 2 +- Library/Homebrew/dev-cmd/pr-pull.rb | 2 +- Library/Homebrew/dev-cmd/pr-upload.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 74e6d140a6..8b71aae62a 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -78,7 +78,7 @@ module Homebrew flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." flag "--root-url-using=", - description: "Use the specified download strategy for the root_url in the generated DSL via `using:' arg" + description: "Use the specified download strategy class for downloading the bottle's URL instead of Homebrew's default." conflicts "--no-rebuild", "--keep-old" diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 521eb0e229..23c1033be4 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -62,7 +62,7 @@ module Homebrew flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." flag "--root-url-using=", - description: "Use the specified download strategy for the root_url in the generated DSL via `using:' arg" + description: "Use the specified download strategy class for downloading the bottle's URL instead of Homebrew's default." flag "--bintray-mirror=", description: "Use the specified Bintray repository to automatically mirror stable URLs "\ "defined in the formulae (default: `mirror`)." diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index a446141008..27adc33068 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -41,7 +41,7 @@ module Homebrew flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." flag "--root-url-using=", - description: "Use the specified download strategy for the root_url in the generated DSL via `using:' arg" + description: "Use the specified download strategy class for downloading the bottle's URL instead of Homebrew's default." named_args :none end From 68852c91623811c34b02fb6e112a904f1eccd22e Mon Sep 17 00:00:00 2001 From: Chris Wegrzyn Date: Thu, 29 Apr 2021 12:51:15 -0400 Subject: [PATCH 7/7] Style fix --- Library/Homebrew/dev-cmd/bottle.rb | 3 ++- Library/Homebrew/dev-cmd/pr-pull.rb | 3 ++- Library/Homebrew/dev-cmd/pr-upload.rb | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 8b71aae62a..9631678b6e 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -78,7 +78,8 @@ module Homebrew flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." flag "--root-url-using=", - description: "Use the specified download strategy class for downloading the bottle's URL instead of Homebrew's default." + description: "Use the specified download strategy class for downloading the bottle's URL instead of "\ + "Homebrew's default." conflicts "--no-rebuild", "--keep-old" diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 23c1033be4..74ee7d8fed 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -62,7 +62,8 @@ module Homebrew flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." flag "--root-url-using=", - description: "Use the specified download strategy class for downloading the bottle's URL instead of Homebrew's default." + description: "Use the specified download strategy class for downloading the bottle's URL instead of "\ + "Homebrew's default." flag "--bintray-mirror=", description: "Use the specified Bintray repository to automatically mirror stable URLs "\ "defined in the formulae (default: `mirror`)." diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index 27adc33068..41a1fd9227 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -41,7 +41,8 @@ module Homebrew flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." flag "--root-url-using=", - description: "Use the specified download strategy class for downloading the bottle's URL instead of Homebrew's default." + description: "Use the specified download strategy class for downloading the bottle's URL instead of "\ + "Homebrew's default." named_args :none end