ruby-changes:72807
From: David <ko1@a...>
Date: Thu, 4 Aug 2022 13:37:03 +0900 (JST)
Subject: [ruby-changes:72807] 0591780a74 (master): [rubygems/rubygems] Extract entry.full_name to a variable
https://git.ruby-lang.org/ruby.git/commit/?id=0591780a74 From 0591780a74f9893038d5d794a958621189953e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Tue, 2 Aug 2022 11:25:51 +0200 Subject: [rubygems/rubygems] Extract entry.full_name to a variable https://github.com/rubygems/rubygems/commit/3973773005 --- lib/rubygems/package.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index 1e87837b0e..8d7aa01f6e 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -411,15 +411,16 @@ EOM https://github.com/ruby/ruby/blob/trunk/lib/rubygems/package.rb#L411 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 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/