Mercurial: Update to 2.0

Also add HEAD.

Closes #8682.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
This commit is contained in:
Colin Hebert authored and Charlie Sharpsteen committed 2011-11-21 09:04:55 -08:00
1 parent a6ddc3264a
commit dd81a2685f
1 file changed
+32 -3
+32 -3
View File
@@ -1,9 +1,19 @@
require 'formula'
class Mercurial < Formula
url 'http://mercurial.selenic.com/release/mercurial-1.9.3.tar.gz'
url 'http://mercurial.selenic.com/release/mercurial-2.0.tar.gz'
homepage 'http://mercurial.selenic.com/'
md5 'f309b084aaf58773e9f4f4d66c49622a'
head 'http://selenic.com/repo/hg', :using => :hg
sha1 '5ede1b3f54d3be2af0657901e7013dde7c19b7c5'
version '2.0'
depends_on 'docutils' => :python if ARGV.build_head? or ARGV.include? "--doc"
def options
[
["--doc", "build the documentation. Depends on 'docutils' module."],
]
end
def install
# Don't add compiler specific flags so we can build against
@@ -16,7 +26,10 @@ class Mercurial < Formula
"setup.py $(PURE) install --install-scripts=\"#{libexec}\""
# Make Mercurial into the Cellar.
# Skip making the docs; depends on 'docutils' module.
# The documentation must be built when using HEAD
if ARGV.build_head? or ARGV.include? "--doc"
system "make", "doc"
end
system "make", "PREFIX=#{prefix}", "build"
system "make", "PREFIX=#{prefix}", "install-bin"
@@ -41,4 +54,20 @@ class Mercurial < Formula
man1.install 'doc/hg.1'
man5.install ['doc/hgignore.5', 'doc/hgrc.5']
end
def caveats
s = ""
if ARGV.build_head?
s += <<-EOS.undent
As mercurial is required to get its own repository, there is now two
installations of mercurial on this machine.
If the previous installation has been done through Homebrew, the old version
needs to be removed and the new one needs to be linked :
brew cleanup mercurial && brew link mercurial
EOS
end
return s
end
end