Pathname#install_metafiles: skip empty files.

Extracted from #10851
This commit is contained in:
Mike McQuaid 2021-03-30 14:16:00 +01:00
parent 6109f00d64
commit 7501d33159
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
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)