cleaner: recursively delete info dirs

Arch-specific build tool formulae (https://github.com/Homebrew/homebrew-core/pull/79874) install their info files in `#{info}/<arch>` to avoid conflicts with the main tool formulae.

However, the info cleaner only removes `#{info}/dir`, so each tool's bottle includes `#{info}/<arch>/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
```
This commit is contained in:
Adrian Ho 2021-06-25 13:10:43 +08:00
parent dc2c0ec8cf
commit 0ec4357ea1

View File

@ -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