From c6da9cadb346cc1d250c7ed6d8fd33c62a11030e Mon Sep 17 00:00:00 2001 From: hsbt Date: Fri, 18 May 2018 01:39:13 +0000 Subject: Merge RubyGems 2.7.7 see release details here: https://blog.rubygems.org/2018/05/18/2.7.7-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/package.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/rubygems/package.rb') diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index b924122827..729bbd6f79 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -429,6 +429,14 @@ EOM destination end + def normalize_path(pathname) + if Gem.win_platform? + pathname.downcase + else + pathname + end + end + def mkdir_p_safe mkdir, mkdir_options, destination_dir, file_name destination_dir = realpath File.expand_path(destination_dir) parts = mkdir.split(File::SEPARATOR) @@ -437,7 +445,7 @@ EOM path = File.expand_path(path + File::SEPARATOR + basename) lstat = File.lstat path rescue nil if !lstat || !lstat.directory? - unless path.start_with? destination_dir and (FileUtils.mkdir path, mkdir_options rescue false) + unless normalize_path(path).start_with? normalize_path(destination_dir) and (FileUtils.mkdir path, mkdir_options rescue false) raise Gem::Package::PathError.new(file_name, destination_dir) end end @@ -591,7 +599,7 @@ EOM end case file_name - when /^metadata(.gz)?$/ then + when "metadata", "metadata.gz" then load_spec entry when 'data.tar.gz' then verify_gz entry -- cgit v1.2.3