aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/utils')
-rw-r--r--Library/Homebrew/utils/git.rb5
-rw-r--r--Library/Homebrew/utils/svn.rb11
2 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb
index dfe47f890..1b4d24894 100644
--- a/Library/Homebrew/utils/git.rb
+++ b/Library/Homebrew/utils/git.rb
@@ -40,4 +40,9 @@ module Utils
@git_path = nil
@git_version = nil
end
+
+ def self.git_remote_exists(url)
+ return true unless git_available?
+ quiet_system "git", "ls-remote", url
+ end
end
diff --git a/Library/Homebrew/utils/svn.rb b/Library/Homebrew/utils/svn.rb
new file mode 100644
index 000000000..fb49ac2e9
--- /dev/null
+++ b/Library/Homebrew/utils/svn.rb
@@ -0,0 +1,11 @@
+module Utils
+ def self.svn_available?
+ return @svn if instance_variable_defined?(:@svn)
+ @svn = quiet_system HOMEBREW_SHIMS_PATH/"scm/svn", "--version"
+ end
+
+ def self.svn_remote_exists(url)
+ return true unless svn_available?
+ quiet_system "svn", "ls", url, "--depth", "empty"
+ end
+end