From 0ec4357ea1af7d7638983ff008a7d56da75ab2c8 Mon Sep 17 00:00:00 2001 From: Adrian Ho Date: Fri, 25 Jun 2021 13:10:43 +0800 Subject: [PATCH] cleaner: recursively delete info `dir`s Arch-specific build tool formulae (https://github.com/Homebrew/homebrew-core/pull/79874) install their info files in `#{info}/` to avoid conflicts with the main tool formulae. However, the info cleaner only removes `#{info}/dir`, so each tool's bottle includes `#{info}//dir`, which causes install-time conflicts. This PR fixes that by deleting all `dir`s under `#{info}`. Before: ``` ==> Cleaning [...] ==> Fixing /usr/local/Cellar/i686-elf-binutils/2.36.1_1/lib/i686-elf/bfd-plugins/libdep.so permissions from 755 to 444 ==> Finishing up ``` After: ``` ==> Cleaning [...] ==> Fixing /usr/local/Cellar/i686-elf-binutils/2.36.1_1/lib/i686-elf/bfd-plugins/libdep.so permissions from 755 to 444 rm /usr/local/Cellar/i686-elf-binutils/2.36.1_1/share/info/i686-elf/dir ==> Finishing up ``` --- Library/Homebrew/cleaner.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb index 76784ff418..ec60e9eac9 100644 --- a/Library/Homebrew/cleaner.rb +++ b/Library/Homebrew/cleaner.rb @@ -29,8 +29,10 @@ class Cleaner [@f.bin, @f.sbin, @f.lib].each { |d| clean_dir(d) if d.exist? } # Get rid of any info 'dir' files, so they don't conflict at the link stage - info_dir_file = @f.info/"dir" - observe_file_removal info_dir_file if info_dir_file.file? && !@f.skip_clean?(info_dir_file) + Dir.glob(@f.info/"**/dir").each do |f| + info_dir_file = Pathname(f) + observe_file_removal info_dir_file if info_dir_file.file? && !@f.skip_clean?(info_dir_file) + end rewrite_shebangs