pathname: do not install empty metafiles

This commit is contained in:
Kenneth Chew 2021-03-26 20:31:09 -04:00
parent 5adf8cbe7b
commit 9d6bfa5965
No known key found for this signature in database
GPG Key ID: BED0BEA07E06CA6C
2 changed files with 3 additions and 1 deletions

View File

@ -432,6 +432,7 @@ class Pathname
def install_metafiles(from = Pathname.pwd)
Pathname(from).children.each do |p|
next if p.directory?
next if File.zero?(p)
next unless Metafiles.copy?(p.basename.to_s)
# Some software symlinks these files (see help2man.rb)

View File

@ -51,7 +51,8 @@ describe FormulaInstaller do
specify "basic installation" do
temporary_install(Testball.new) do |f|
# Test that things made it into the Keg
expect(f.prefix/"readme").to exist
# "readme" is empty, so it should not be installed
expect(f.prefix/"readme").not_to exist
expect(f.bin).to be_a_directory
expect(f.bin.children.count).to eq(3)