summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/package.rb10
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 53be979a52..4ab0da9acf 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -10,7 +10,7 @@ require 'rbconfig'
require 'thread'
module Gem
- VERSION = "2.6.14.2"
+ VERSION = "2.6.14.3"
end
# Must be first since it unloads the prelude from 1.9.2
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb
index b5a5fe2a26..1dd28d8132 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