From b9fc7e100b2bfeb9ed90028c0dd5f4635c943934 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 24 Nov 2020 21:58:40 +0100 Subject: [PATCH] Add more BOM debug information. --- Library/Homebrew/unpack_strategy/dmg.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/unpack_strategy/dmg.rb b/Library/Homebrew/unpack_strategy/dmg.rb index 970811bd5c..b8395ddef5 100644 --- a/Library/Homebrew/unpack_strategy/dmg.rb +++ b/Library/Homebrew/unpack_strategy/dmg.rb @@ -106,9 +106,18 @@ module UnpackStrategy 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") + all_paths_find = system_command("find", args: [".", "-print0"], chdir: path, print_stderr: false) + .stdout + .split("\0") + + all_paths_ruby = Pathname.glob(path/"**/*", File::FNM_DOTMATCH) + .map { |p| p.relative_path_from(path).to_s } + + odebug "BOM contents:", bom + odebug "BOM contents (retry):", path.bom + odebug "Directory contents (find):", all_paths_find.join("\n") + odebug "Directory contents (Ruby):", all_paths_ruby.join("\n") end FileUtils.chmod "u+w", Pathname.glob(unpack_dir/"**/*", File::FNM_DOTMATCH).reject(&:symlink?)