diff options
Diffstat (limited to 'lib/rubygems/package.rb')
-rw-r--r-- | lib/rubygems/package.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index 65db3f8e2e..ba379c24cb 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -339,9 +339,13 @@ EOM def extract_tar_gz io, destination_dir, pattern = "*" # :nodoc: open_tar_gz io do |tar| tar.each do |entry| - next unless File.fnmatch pattern, entry.full_name + # Some entries start with "./" which fnmatch does not like, see github + # issue #644 + full_name = entry.full_name.sub %r%\A\./%, '' - destination = install_location entry.full_name, destination_dir + next unless File.fnmatch pattern, full_name + + destination = install_location full_name, destination_dir FileUtils.rm_rf destination |