summaryrefslogtreecommitdiff
path: root/lib/rubygems/package.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-18 01:39:13 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-18 01:39:13 +0000
commitc6da9cadb346cc1d250c7ed6d8fd33c62a11030e (patch)
tree83bea4d75a82b41f265b884a6fb4ffe418b41f94 /lib/rubygems/package.rb
parentecedebab2c559386c86f98be364c0e6941c2a405 (diff)
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
Diffstat (limited to 'lib/rubygems/package.rb')
-rw-r--r--lib/rubygems/package.rb12
1 files changed, 10 insertions, 2 deletions
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