aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2013-07-15 19:03:08 -0700
committerMike McQuaid2013-07-16 13:29:37 -0700
commita3ea2b566b12fb15da5270b3fb26f3f07dbb9780 (patch)
tree267b0573a42ee4c506f8e265ac9e41e902570876 /Library
parent8f0a073bf6329976b85950a66be696cddb03f5ea (diff)
downloadbrew-a3ea2b566b12fb15da5270b3fb26f3f07dbb9780.tar.bz2
FormulaInstaller: cleanup check_/audit_ functions.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb54
1 files changed, 27 insertions, 27 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index b1860dbdc..b24424164 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -231,8 +231,8 @@ class FormulaInstaller
audit_bin
audit_sbin
audit_lib
- check_manpages
- check_infopages
+ audit_man
+ audit_info
end
c = Caveats.new(f)
@@ -257,7 +257,6 @@ class FormulaInstaller
end
else
link
- check_PATH unless f.keg_only?
end
fix_install_names
@@ -438,16 +437,14 @@ class FormulaInstaller
## checks
- def check_PATH
+ def check_PATH bin
# warn the user if stuff was installed outside of their PATH
- [f.bin, f.sbin].each do |bin|
- if bin.directory? and bin.children.length > 0
- bin = (HOMEBREW_PREFIX/bin.basename).realpath
- unless ORIGINAL_PATHS.include? bin
- opoo "#{bin} is not in your PATH"
- puts "You can amend this by altering your ~/.bashrc file"
- @show_summary_heading = true
- end
+ if bin.directory? and bin.children.length > 0
+ bin = (HOMEBREW_PREFIX/bin.basename).realpath
+ unless ORIGINAL_PATHS.include? bin
+ opoo "#{bin} is not in your PATH"
+ puts "You can amend this by altering your ~/.bashrc file"
+ @show_summary_heading = true
end
end
end
@@ -508,10 +505,8 @@ class FormulaInstaller
end
end
- def audit_bin
- return unless f.bin.directory?
-
- non_exes = f.bin.children.select { |g| g.directory? or not g.executable? }
+ def check_non_executables bin
+ non_exes = bin.children.select { |g| g.directory? or not g.executable? }
unless non_exes.empty?
opoo 'Non-executables were installed to "bin".'
@@ -523,19 +518,16 @@ class FormulaInstaller
end
end
+ def audit_bin
+ return unless f.bin.directory?
+ check_PATH f.bin unless f.keg_only?
+ check_non_executables f.bin
+ end
+
def audit_sbin
return unless f.sbin.directory?
-
- non_exes = f.sbin.children.select { |g| g.directory? or not g.executable? }
-
- unless non_exes.empty?
- opoo 'Non-executables were installed to "sbin".'
- puts "Installing non-executables to \"sbin\" is bad practice."
- puts "The offending files are:"
- puts non_exes
- @show_summary_heading = true
- Homebrew.failed = true # fatal to Brew Bot
- end
+ check_PATH f.sbin unless f.keg_only?
+ check_non_executables f.sbin
end
def audit_lib
@@ -543,6 +535,14 @@ class FormulaInstaller
check_non_libraries
end
+ def audit_man
+ check_manpages
+ end
+
+ def audit_info
+ check_infopages
+ end
+
private
def hold_locks?