Merge pull request #11057 from MikeMcQuaid/github_packages_more_fixes

More GitHub Packages bulk upload fixes
This commit is contained in:
Mike McQuaid 2021-04-07 17:26:03 +01:00 committed by GitHub
commit 1435018e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 6 deletions

View File

@ -14,7 +14,7 @@ Lint/NestedMethodDefinition:
# TODO: Try to bring down all metrics maximums.
Metrics/AbcSize:
Max: 275
Max: 280
Metrics/BlockLength:
Max: 100
Exclude:

View File

@ -531,7 +531,11 @@ module Homebrew
"tap_git_path" => f.path.to_s.delete_prefix("#{tap_path}/"),
"tap_git_revision" => tap_git_revision,
"tap_git_remote" => tap_git_remote,
"desc" => f.desc,
# descriptions can contain emoji. sigh.
"desc" => f.desc.encode(
Encoding.find("ASCII"),
invalid: :replace, undef: :replace, replace: "",
).strip,
"license" => SPDX.license_expression_to_string(f.license),
"homepage" => f.homepage,
},

View File

@ -61,7 +61,7 @@ module Formulary
# access them from within the formula's class scope.
mod.const_set(:BUILD_FLAGS, flags)
mod.module_eval(contents, path)
rescue NameError, ArgumentError, ScriptError, MethodDeprecatedError => e
rescue NameError, ArgumentError, ScriptError, MethodDeprecatedError, MacOSVersionError => e
remove_const(namespace)
raise FormulaUnreadableError.new(name, e)
end
@ -246,7 +246,7 @@ module Formulary
end
def load_file(flags:)
if %r{githubusercontent.com/[\w-]+/[\w-]+/[a-f0-9]{40}(?:/Formula)?/(?<formula_name>[\w+-.@]+).rb} =~ url # rubocop:disable Style/CaseLikeIf
if %r{githubusercontent.com/[\w-]+/[\w-]+/[a-f0-9]{40}(?:/Formula)?/(?<formula_name>[\w+-.@]+).rb} =~ url
raise UsageError, "Installation of #{formula_name} from a GitHub commit URL is unsupported! " \
"`brew extract #{formula_name}` to a stable tap on GitHub instead."
elsif url.match?(%r{^(https?|ftp)://})

View File

@ -195,9 +195,9 @@ class GitHubPackages
puts
inspect_args = ["inspect", image_uri.to_s]
if dry_run
puts "#{skopeo} #{inspect_args.join(" ")} --dest-creds=#{user}:$HOMEBREW_GITHUB_PACKAGES_TOKEN"
puts "#{skopeo} #{inspect_args.join(" ")} --creds=#{user}:$HOMEBREW_GITHUB_PACKAGES_TOKEN"
else
inspect_args << "--dest-creds=#{user}:#{token}"
inspect_args << "--creds=#{user}:#{token}"
inspect_result = system_command(skopeo, args: inspect_args)
if inspect_result.status.success?
if warn_on_error