From ffbabfd2380713f15579e8830249ec4aea12e180 Mon Sep 17 00:00:00 2001 From: Chris Wegrzyn Date: Wed, 28 Apr 2021 14:57:41 -0400 Subject: [PATCH] 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?