--- pkg_deinstall.orig 2022-09-18 23:07:28.115346000 +0900 +++ pkg_deinstall 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