aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMax Howell2010-11-09 13:00:33 +0000
committerAdam Vandenberg2011-03-12 11:55:03 -0800
commit5cd927b8b5ba69ed3fae4f189d5b6071bb1a2d7e (patch)
treeb8e06232cd5b085fafffba34e7f661eabc78dd46 /Library/Homebrew/cmd
parent65f840fb0649dbdee9af01f7f2446af97924f80a (diff)
downloadhomebrew-5cd927b8b5ba69ed3fae4f189d5b6071bb1a2d7e.tar.bz2
Some Cleanup
Diffstat (limited to 'Library/Homebrew/cmd')
-rwxr-xr-xLibrary/Homebrew/cmd/audit.rb46
-rw-r--r--Library/Homebrew/cmd/doctor.rb86
-rw-r--r--Library/Homebrew/cmd/install.rb14
3 files changed, 74 insertions, 72 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 4096ebff8..5580eaeeb 100755
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -206,33 +206,33 @@ def audit_formula_instance f
end
module Homebrew extend self
-def audit
- ff.each do |f|
- problems = []
- problems += audit_formula_instance f
- problems += audit_formula_urls f
-
- text = ""
- File.open(f.path, "r") { |afile| text = afile.read }
-
- # DATA with no __END__
- if (text =~ /\bDATA\b/) and not (text =~ /^\s*__END__\s*$/)
- problems << " * 'DATA' was found, but no '__END__'"
- end
+ def audit
+ ff.each do |f|
+ problems = []
+ problems += audit_formula_instance f
+ problems += audit_formula_urls f
+
+ text = ""
+ File.open(f.path, "r") { |afile| text = afile.read }
- problems += [' * invalid or missing version'] if f.version.to_s.empty?
+ # DATA with no __END__
+ if (text =~ /\bDATA\b/) and not (text =~ /^\s*__END__\s*$/)
+ problems << " * 'DATA' was found, but no '__END__'"
+ end
- # Don't try remaining audits on text in __END__
- text_without_patch = (text.split("__END__")[0]).strip()
+ problems += [' * invalid or missing version'] if f.version.to_s.empty?
- problems += audit_formula_text(text_without_patch)
- problems += audit_formula_options(f, text_without_patch)
+ # Don't try remaining audits on text in __END__
+ text_without_patch = (text.split("__END__")[0]).strip()
- unless problems.empty?
- puts "#{f.name}:"
- puts problems * "\n"
- puts
+ problems += audit_formula_text(text_without_patch)
+ problems += audit_formula_options(f, text_without_patch)
+
+ unless problems.empty?
+ puts "#{f.name}:"
+ puts problems * "\n"
+ puts
+ end
end
end
end
-end
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index bad3a5dc0..7ea616d76 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -584,50 +584,50 @@ def check_for_other_vars
end
module Homebrew extend self
-def doctor
- read, write = IO.pipe
-
- if fork == nil
- read.close
- $stdout.reopen write
-
- check_usr_bin_ruby
- check_homebrew_prefix
- check_for_macgpg2
- check_for_stray_dylibs
- check_gcc_versions
- check_cc_symlink
- check_for_other_package_managers
- check_for_x11
- check_for_nonstandard_x11
- check_access_share_locale
- check_access_share_man
- check_access_include
- check_access_etc
- check_user_path
- check_which_pkg_config
- check_pkg_config_paths
- check_access_pkgconfig
- check_for_gettext
- check_for_config_scripts
- check_for_dyld_vars
- check_for_other_vars
- check_for_symlinked_cellar
- check_for_multiple_volumes
- check_for_git
- check_for_autoconf
- check_for_linked_kegonly_brews
-
- exit! 0
- else
- write.close
-
- unless (out = read.read).chomp.empty?
- puts out
+ def doctor
+ read, write = IO.pipe
+
+ if fork == nil
+ read.close
+ $stdout.reopen write
+
+ check_usr_bin_ruby
+ check_homebrew_prefix
+ check_for_macgpg2
+ check_for_stray_dylibs
+ check_gcc_versions
+ check_cc_symlink
+ check_for_other_package_managers
+ check_for_x11
+ check_for_nonstandard_x11
+ check_access_share_locale
+ check_access_share_man
+ check_access_include
+ check_access_etc
+ check_user_path
+ check_which_pkg_config
+ check_pkg_config_paths
+ check_access_pkgconfig
+ check_for_gettext
+ check_for_config_scripts
+ check_for_dyld_vars
+ check_for_other_vars
+ check_for_symlinked_cellar
+ check_for_multiple_volumes
+ check_for_git
+ check_for_autoconf
+ check_for_linked_kegonly_brews
+
+ exit! 0
else
- puts "Your OS X is ripe for brewing."
- puts "Any troubles you may be experiencing are likely purely psychosomatic."
+ write.close
+
+ unless (out = read.read).chomp.empty?
+ puts out
+ else
+ puts "Your OS X is ripe for brewing."
+ puts "Any troubles you may be experiencing are likely purely psychosomatic."
+ end
end
end
end
-end
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index 2102d2182..d1b4519c6 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -13,15 +13,17 @@ module Homebrew extend self
end
def check_ppc
- case Hardware.cpu_type when :ppc, :dunno
- abort "Sorry, Homebrew does not support your computer's CPU architecture.\n"+
- "For PPC support, see: http://github.com/sceaga/homebrew/tree/powerpc"
- end
+ case Hardware.cpu_type when :ppc, :dunno
+ abort <<-EOS.undent
+ Sorry, Homebrew does not support your computer's CPU architecture.
+ For PPC support, see: http://github.com/sceaga/homebrew/tree/powerpc
+ EOS
+ end
end
def check_writable_install_location
- raise "Cannot write to #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.exist? and not HOMEBREW_CELLAR.writable?
- raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable?
+ raise "Cannot write to #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.exist? and not HOMEBREW_CELLAR.writable?
+ raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable?
end
def check_cc