--- bin/pkg_glob.orig 2018-10-10 16:03:41.664989000 +0900 +++ bin/pkg_glob 2022-09-19 01:58:08.652655000 +0900 @@ -377,13 +377,16 @@ end end - IO.popen("/usr/bin/file -bnf-", "r+") do |pipe| - filelist.each do |file| - %r"^[^@\s]\S*/([^/\s]+\.so(?:\.\d+)+)$" =~ file or next + filelist.each do |file| + %r"^[^@\s]\S*/([^/\s]+\.so(?:\.\d+)+)$" =~ file or next - base = $1 + base = $1 + IO.popen("/usr/bin/file -bnf-", "r+") do |pipe| + pipe.puts(file) + + pipe.close_write filetype = pipe.gets @@ -398,7 +401,7 @@ def deinstall_pkg(pkgname) next if $noexecute - if system('/bin/cp', '-Rpf', file, dest) + if system('/bin/cp', '-pf', file, dest) preserved_files << dest else STDERR.puts "Copy failed!"