aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/dependency_collector.rb4
-rw-r--r--Library/Homebrew/os/mac/xcode.rb4
-rw-r--r--Library/Homebrew/requirements.rb13
-rw-r--r--Library/Homebrew/test/dependency_collector_spec.rb12
4 files changed, 27 insertions, 6 deletions
diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb
index bc0246dd2..f8edbab06 100644
--- a/Library/Homebrew/dependency_collector.rb
+++ b/Library/Homebrew/dependency_collector.rb
@@ -159,7 +159,9 @@ class DependencyCollector
elsif strategy <= BazaarDownloadStrategy
Dependency.new("bazaar", tags)
elsif strategy <= CVSDownloadStrategy
- Dependency.new("cvs", tags) if MacOS.version >= :mavericks || !MacOS::Xcode.provides_cvs?
+ CVSRequirement.new(tags)
+ elsif strategy <= SubversionDownloadStrategy
+ SubversionRequirement.new(tags)
elsif strategy < AbstractDownloadStrategy
# allow unknown strategies to pass through
else
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index ae725d948..0b1cc7146 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -174,10 +174,6 @@ module OS
version < "4.3"
end
- def provides_cvs?
- version < "5.0"
- end
-
def default_prefix?
if version < "4.3"
prefix.to_s.start_with? "/Developer"
diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb
index 35a0c242c..d5992b88d 100644
--- a/Library/Homebrew/requirements.rb
+++ b/Library/Homebrew/requirements.rb
@@ -114,10 +114,15 @@ class ArchRequirement < Requirement
end
end
+class CVSRequirement < Requirement
+ fatal true
+ default_formula "cvs"
+ satisfy { which "cvs" }
+end
+
class MercurialRequirement < Requirement
fatal true
default_formula "mercurial"
-
satisfy { which("hg") }
end
@@ -126,3 +131,9 @@ class GitRequirement < Requirement
default_formula "git"
satisfy { Utils.git_available? }
end
+
+class SubversionRequirement < Requirement
+ fatal true
+ default_formula "subversion"
+ satisfy { Utils.svn_available? }
+end
diff --git a/Library/Homebrew/test/dependency_collector_spec.rb b/Library/Homebrew/test/dependency_collector_spec.rb
index c25ea9cf9..8feeac4a2 100644
--- a/Library/Homebrew/test/dependency_collector_spec.rb
+++ b/Library/Homebrew/test/dependency_collector_spec.rb
@@ -84,6 +84,18 @@ describe DependencyCollector do
expect(subject.add(resource)).to be_an_instance_of(GitRequirement)
end
+ it "creates a resource dependency from a CVS URL" do
+ resource = Resource.new
+ resource.url(":pserver:anonymous:@example.com:/cvsroot/foo/bar", using: :cvs)
+ expect(subject.add(resource)).to be_an_instance_of(CVSRequirement)
+ end
+
+ it "creates a resource dependency from a Subversion URL" do
+ resource = Resource.new
+ resource.url("svn://example.com/foo/bar")
+ expect(subject.add(resource)).to be_an_instance_of(SubversionRequirement)
+ end
+
it "creates a resource dependency from a '.7z' URL" do
resource = Resource.new
resource.url("http://example.com/foo.7z")