diff options
| author | Adam Vandenberg | 2009-08-11 14:19:23 -0700 |
|---|---|---|
| committer | Max Howell | 2009-08-24 01:03:30 +0100 |
| commit | 57a86034a3aabefc7fc0aa9cc999c0fe38145c83 (patch) | |
| tree | 75449e573140278efe5a581a50bd031767960170 /Library | |
| parent | 0eaf4bbcd9e4afb8a92a678ee072e8167e841527 (diff) | |
| download | brew-57a86034a3aabefc7fc0aa9cc999c0fe38145c83.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/Homebrew/formula.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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=[] |
