summaryrefslogtreecommitdiff
path: root/lib/rubygems/package.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2022-08-02 10:27:42 +0200
committergit <[email protected]>2022-08-04 13:36:45 +0900
commit542040fb8375ffd74096ae0615a33bbc90524cb3 ()
tree2cea6b5f9c8275e766f95f9a2137fe78e4ee09cc /lib/rubygems/package.rb
parent0591780a74f9893038d5d794a958621189953e8a (diff)
[rubygems/rubygems] Warn dangling symlinks
https://.com/rubygems/rubygems/commit/425b78637f
-rw-r--r--lib/rubygems/package.rb14
1 files changed, 12 insertions, 2 deletions
@@ -409,6 +409,8 @@ EOM
def extract_tar_gz(io, destination_dir, pattern = "*") # :nodoc:
directories = []
open_tar_gz io do |tar|
tar.each do |entry|
full_name = entry.full_name
@@ -422,6 +424,8 @@ EOM
raise Gem::Package::SymlinkError.new(full_name, real_destination, destination_dir) unless
normalize_path(real_destination).start_with? normalize_path(destination_dir + "/")
end
FileUtils.rm_rf destination
@@ -445,12 +449,18 @@ EOM
FileUtils.chmod file_mode(entry.header.mode), destination
end if entry.file?
- File.symlink(entry.header.linkname, destination) if entry.symlink?
-
verbose destination
end
end
if dir_mode
File.chmod(dir_mode, *directories)
end