From 03f5db01e6be9b522d6fbbfb54f07d168c1a3a34 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 18 Jan 2023 23:42:18 +0900 Subject: [PATCH] Make installation messages verbose a little [ci skip] --- tool/rbinstall.rb | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 02ce7faaa74f5b..85d05eff2518d0 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -999,6 +999,7 @@ def install_default_gem(dir, srcdir, bindir) end installed_gems = {} + skipped = {} options = { :install_dir => install_dir, :bin_dir => with_destdir(bindir), @@ -1029,11 +1030,20 @@ def install_default_gem(dir, srcdir, bindir) path = "#{srcdir}/.bundle/specifications/#{gem_name}.gemspec" unless File.exist?(path) path = "#{srcdir}/.bundle/gems/#{gem_name}/#{gem_name}.gemspec" - next unless File.exist?(path) + unless File.exist?(path) + skipped[gem_name] = "gemspec not found" + next + end end spec = load_gemspec(path, "#{srcdir}/.bundle/gems/#{gem_name}") - next unless spec.platform == Gem::Platform::RUBY - next unless spec.full_name == gem_name + unless spec.platform == Gem::Platform::RUBY + skipped[gem_name] = "not ruby platform (#{spec.platform})" + next + end + unless spec.full_name == gem_name + skipped[gem_name] = "full name unmatch #{spec.full_name}" + next + end spec.extension_dir = "#{extensions_dir}/#{spec.full_name}" package = RbInstall::DirPackage.new spec ins = RbInstall::UnpackedInstaller.new(package, options) @@ -1051,7 +1061,11 @@ def install_default_gem(dir, srcdir, bindir) install installed_gems, gem_dir+"/cache" end unless gems.empty? - puts "skipped bundled gems: #{gems.join(' ')}" + skipped.default = "not found in bundled_gems" + puts "skipped bundled gems:" + gems.each do |gem| + printf " %-32s%s\n", File.basename(gem), skipped[gem] + end end end @@ -1071,6 +1085,7 @@ def install_default_gem(dir, srcdir, bindir) end installs.flatten! installs -= $exclude.map {|exc| $install_procs[exc]}.flatten +puts "Installing to #$destdir" unless installs.empty? installs.each do |block| dir = Dir.pwd begin