aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2011-09-02 15:14:12 -0500
committerJack Nagel2011-09-02 15:15:46 -0500
commitfa3eeeeb9746829955d4a1abe9f7e38910312bc8 (patch)
treeb41c68fd16738eb8ab03daa769900b88d86c5af5
parent57d2a1b5139d71e6ad980772c75f93cc65b64947 (diff)
downloadhomebrew-fa3eeeeb9746829955d4a1abe9f7e38910312bc8.tar.bz2
bash-completion: fix-up HEAD install
The bash-completion that is installed from head has an entirely new directory structure. I believe it has some measure of backwards compatibility in that it will find completion scripts in the old location, but users still have to source a different file to get it to actually work, so the caveats have been updated to reflect that. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-rw-r--r--Library/Formula/bash-completion.rb42
1 files changed, 33 insertions, 9 deletions
diff --git a/Library/Formula/bash-completion.rb b/Library/Formula/bash-completion.rb
index 1cbfcbd82..c44bfe3ff 100644
--- a/Library/Formula/bash-completion.rb
+++ b/Library/Formula/bash-completion.rb
@@ -16,9 +16,15 @@ class BashCompletion < Formula
system "aclocal"
system "autoconf"
system "automake --add-missing"
+ system "./configure", "--prefix=#{prefix}"
+
+ inreplace 'Makefile' do |s|
+ s.change_make_var! "pkgconfigdir", "#{lib}/pkgconfig"
+ end
+ else
+ system "./configure", "--prefix=#{prefix}"
end
- system "./configure", "--prefix=#{prefix}"
system "make install"
# Cause the build to fails if you haven't already installed git or something else that
@@ -27,14 +33,32 @@ class BashCompletion < Formula
# File.exists? "#{etc}/bash_completion.d/brew_bash_completion.sh" or File.symlink? "#{etc}/bash_completion.d/brew_bash_completion.sh"
end
- def caveats; <<-EOS.undent
- Add the following lines to your ~/.bash_profile file:
- if [ -f `brew --prefix`/etc/bash_completion ]; then
- . `brew --prefix`/etc/bash_completion
- fi
+ def caveats
+ if ARGV.build_head?
+ <<-EOS.undent
+ Add the following lines to your ~/.bash_profile file:
+ if [ -f `brew --prefix`/share/bash-completion/bash_completion ]; then
+ . `brew --prefix`/share/bash-completion/bash_completion
+ fi
+
+ Some formula install their own completion scripts. To use them with the
+ HEAD version of bash-completion, link them into
- To install Homebrew's own completion script:
- ln -s "#{HOMEBREW_PREFIX}/Library/Contributions/brew_bash_completion.sh" "#{etc}/bash_completion.d"
- EOS
+ #{HOMEBREW_PREFIX}/share/bash-completion/completions
+
+ To install Homebrew's own completion script:
+ ln -s "#{HOMEBREW_PREFIX}/Library/Contributions/brew_bash_completion.sh" "#{HOMEBREW_PREFIX}/share/bash-completion/completions"
+ EOS
+ else
+ <<-EOS.undent
+ Add the following lines to your ~/.bash_profile file:
+ if [ -f `brew --prefix`/etc/bash_completion ]; then
+ . `brew --prefix`/etc/bash_completion
+ fi
+
+ To install Homebrew's own completion script:
+ ln -s "#{HOMEBREW_PREFIX}/Library/Contributions/brew_bash_completion.sh" "#{etc}/bash_completion.d"
+ EOS
+ end
end
end