1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Extract entry.full_name to a variable

https://github.com/rubygems/rubygems/commit/3973773005
This commit is contained in:
David Rodríguez 2022-08-02 11:25:51 +02:00 committed by git
parent 3944862066
commit 0591780a74

View file

@ -411,15 +411,16 @@ EOM
directories = []
open_tar_gz io do |tar|
tar.each do |entry|
next unless File.fnmatch pattern, entry.full_name, File::FNM_DOTMATCH
full_name = entry.full_name
next unless File.fnmatch pattern, full_name, File::FNM_DOTMATCH
destination = install_location entry.full_name, destination_dir
destination = install_location full_name, destination_dir
if entry.symlink?
link_target = entry.header.linkname
real_destination = link_target.start_with?("/") ? link_target : File.expand_path(link_target, File.dirname(destination))
raise Gem::Package::SymlinkError.new(entry.full_name, real_destination, destination_dir) unless
raise Gem::Package::SymlinkError.new(full_name, real_destination, destination_dir) unless
normalize_path(real_destination).start_with? normalize_path(destination_dir + "/")
end