aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2009-08-11 14:19:23 -0700
committerMax Howell2009-08-24 01:03:30 +0100
commit840697851016c6405dedaaf6161a097b2d040e37 (patch)
treefee31332a023dfc773fcd266a0f5b58a3075bfb9 /Library
parent9d83e666e341b7d1d44f0240974f07b39c0d58b2 (diff)
downloadhomebrew-840697851016c6405dedaaf6161a097b2d040e37.tar.bz2
Support building from Subversion repositories
Adds a new DownloadStrategy that checks files out from Subversion to the cache, then exports over to the temp folder for the build. To use checkout with the svn:// protocol or reimplement download_strategy and return SubversionDownloadStrategy.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/ack.rb4
-rw-r--r--Library/Homebrew/formula.rb17
2 files changed, 21 insertions, 0 deletions
diff --git a/Library/Formula/ack.rb b/Library/Formula/ack.rb
index 1c573d789..479f31521 100644
--- a/Library/Formula/ack.rb
+++ b/Library/Formula/ack.rb
@@ -5,4 +5,8 @@ class Ack <ScriptFileFormula
@url="http://ack.googlecode.com/svn/tags/#{@version}/ack"
@md5='8009a13ab0fc66047bea0ea2ad89419c'
@homepage='http://betterthangrep.com/'
+
+ def download_strategy
+ HttpDownloadStrategy
+ end
end \ No newline at end of file
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 2b3d3d996..80b2d6a28 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -72,6 +72,23 @@ private
end
end
+class SubversionDownloadStrategy <AbstractDownloadStrategy
+ def fetch
+ ohai "Checking out #{@url}"
+ @co=HOMEBREW_CACHE+@unique_token
+ unless @co.exist?
+ safe_system 'svn', 'checkout', @url, @co
+ else
+ # TODO svn up?
+ puts "Repository already checked out"
+ end
+ end
+ def stage
+ # Force the export, since the target directory will already exist
+ safe_system 'svn', 'export', '--force', @co, Dir.pwd
+ end
+end
+
class ExecutionError <RuntimeError
def initialize cmd, args=[]