зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] better error message if cargo metadata doesn't contain the package we expect
https://github.com/rubygems/rubygems/commit/cb7e6d1577
This commit is contained in:
Родитель
b4defea362
Коммит
c5a34f5b56
|
@ -225,6 +225,17 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|||
# avoid the json dependency
|
||||
metadata = Gem::SafeYAML.safe_load(output)
|
||||
package = metadata["packages"].find {|pkg| pkg["manifest_path"] == manifest_path }
|
||||
unless package
|
||||
found = metadata["packages"].map {|md| "#{md["name"]} at #{md["manifest_path"]}" }
|
||||
raise Gem::InstallError, <<-EOF
|
||||
failed to determine cargo package name
|
||||
|
||||
looking for: #{manifest_path}
|
||||
|
||||
found:
|
||||
#{found.join("\n")}
|
||||
EOF
|
||||
end
|
||||
package["name"].tr("-", "_")
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче