diff options
| author | Max Howell | 2009-09-16 19:29:43 +0100 |
|---|---|---|
| committer | Max Howell | 2009-09-17 18:42:56 +0100 |
| commit | 506026e0b1ae92b8f5f96fd3fa538a661f29599e (patch) | |
| tree | c1797b80202e3c2f0a046a5348d109d41b520aec /Library | |
| parent | 0122fb9a48a75a87cf038b1a81f28b6a5b9cfcce (diff) | |
| download | homebrew-506026e0b1ae92b8f5f96fd3fa538a661f29599e.tar.bz2 | |
Prettier install output
This way caveats and other warnings/errors don't appear connected to the Summary text.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/dovecot.rb | 5 | ||||
| -rwxr-xr-x | Library/Homebrew/install.rb | 19 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 13 |
3 files changed, 18 insertions, 19 deletions
diff --git a/Library/Formula/dovecot.rb b/Library/Formula/dovecot.rb index 3f00bcdd2..26d5ede7b 100644 --- a/Library/Formula/dovecot.rb +++ b/Library/Formula/dovecot.rb @@ -18,9 +18,7 @@ class Dovecot <Formula # TODO: automate some of the caveats? end - def caveats - puts <<-EOS -============================================================== + def caveats; <<-EOS For Dovecot to work, you will need to do the following: 1) create configuration in #{prefix}/etc @@ -45,7 +43,6 @@ For Dovecot to work, you will need to do the following: </plist> 4) start the server using: sudo launchctl load /Library/LaunchDaemons/org.dovecot.plist -============================================================== EOS end end diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 3b06cf8bc..3f887e99a 100755 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -4,8 +4,10 @@ require 'formula' require 'keg' require 'brew.h' +show_summary_heading = false + def install f - build_time=nil + build_time = nil begin f.brew do @@ -26,7 +28,7 @@ def install f FileUtils.mv "#{file}.txt", file rescue nil f.prefix.install file rescue nil end - build_time=Time.now-beginning + build_time = Time.now-beginning end end rescue Exception @@ -37,7 +39,11 @@ def install f raise end - ohai "Caveats", f.caveats, '' + if f.caveats + ohai "Caveats", f.caveats + show_summary_heading = true + end + ohai 'Finishing up' if ARGV.verbose? begin @@ -46,6 +52,7 @@ def install f opoo "The cleaning step did not complete successfully" puts "Still, the installation was successful, so we will link it into your prefix" ohai e, e.inspect if ARGV.debug? + show_summary_heading = true end raise "Nothing was installed to #{f.prefix}" unless f.installed? @@ -59,6 +66,7 @@ def install f unless paths.include? rootbin opoo "#{rootbin} is not in your PATH" puts "You can amend this by altering your ~/.bashrc file" + show_summary_heading = true end end end @@ -70,11 +78,10 @@ def install f puts "The package built, but is not symlinked into #{HOMEBREW_PREFIX}" puts "You can try again using `brew link #{f.name}'" ohai e, e.inspect if ARGV.debug? - ohai "Summary" - else - ohai "Summary" if ARGV.verbose? + show_summary_heading = true end + ohai "Summary" if ARGV.verbose? or show_summary_heading print "#{f.prefix}: #{f.prefix.abv}" print ", built in #{pretty_duration build_time}" if build_time puts diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 8606b21fe..7658e35cb 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -22,15 +22,10 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # args are additional inputs to puts until a nil arg is encountered -def ohai title, *args - return if args.length > 0 and args[0].nil? - n=`tput cols`.strip.to_i-4 - n=title.length if ARGV.verbose? - puts "\033[0;34m==>\033[0;0;1m #{title[0,n]}\033[0;0m" - args.each do |arg| - return if arg.nil? - puts arg - end +def ohai title, *sput + title = title[0, `tput cols`.strip.to_i-4] unless ARGV.verbose? + puts "\033[0;34m==>\033[0;0;1m #{title}\033[0;0m" + puts *sput unless sput.empty? end # shows a warning in delicious pink |
