From c32415529532369c6fffdd34c95da1ee21546f87 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 24 Nov 2020 18:26:15 +0100 Subject: [PATCH] Add debug information for empty BOM error. --- Library/Homebrew/unpack_strategy/dmg.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/unpack_strategy/dmg.rb b/Library/Homebrew/unpack_strategy/dmg.rb index db6f3285d5..970811bd5c 100644 --- a/Library/Homebrew/unpack_strategy/dmg.rb +++ b/Library/Homebrew/unpack_strategy/dmg.rb @@ -91,8 +91,10 @@ module UnpackStrategy Tempfile.open(["", ".bom"]) do |bomfile| bomfile.close + bom = path.bom + Tempfile.open(["", ".list"]) do |filelist| - filelist.puts(path.bom) + filelist.puts(bom) filelist.close system_command! "mkbom", @@ -100,9 +102,14 @@ module UnpackStrategy verbose: verbose end - system_command! "ditto", - args: ["--bom", bomfile.path, "--", path, unpack_dir], - verbose: verbose + result = system_command! "ditto", + args: ["--bom", bomfile.path, "--", path, unpack_dir], + verbose: verbose + + odebug "BOM contents:", bom + if result.stderr.include?("contains no files, nothing copied") + odebug "Directory contents:", Pathname.glob(path/"**/*", File::FNM_DOTMATCH).map(&:to_s).join("\n") + end FileUtils.chmod "u+w", Pathname.glob(unpack_dir/"**/*", File::FNM_DOTMATCH).reject(&:symlink?) end