diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 59061af88e..b9730a89f8 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -359,8 +359,7 @@ class Pathname # Writes a wrapper env script and moves all files to the dst def env_script_all_files dst, env dst.mkpath - Dir["#{self}/*"].each do |file| - file = Pathname.new(file) + Pathname.glob("#{self}/*") do |file| dst.install_p file new_file = dst+file.basename file.write_env_script(new_file, env) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 28061442e7..7321f9c4de 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -649,8 +649,7 @@ class FormulaInstaller downloader.stage end - Dir["#{f.bottle_prefix}/{etc,var}/**/*"].each do |file| - path = Pathname.new(file) + Pathname.glob("#{f.bottle_prefix}/{etc,var}/**/*") do |path| path.extend(InstallRenamed) path.cp_path_sub(f.bottle_prefix, HOMEBREW_PREFIX) end