From 7501d33159aadaabe2435373ceca2bb371aa8ef8 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 30 Mar 2021 14:16:00 +0100 Subject: [PATCH] Pathname#install_metafiles: skip empty files. Extracted from #10851 --- Library/Homebrew/extend/pathname.rb | 1 + Library/Homebrew/test/formula_installer_spec.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 3930deb3bc..0582e55e86 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -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) diff --git a/Library/Homebrew/test/formula_installer_spec.rb b/Library/Homebrew/test/formula_installer_spec.rb index b4233dfaff..742f6a2d81 100644 --- a/Library/Homebrew/test/formula_installer_spec.rb +++ b/Library/Homebrew/test/formula_installer_spec.rb @@ -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)