aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
authorMike McQuaid2017-02-24 17:14:39 +0000
committerGitHub2017-02-24 17:14:39 +0000
commit7077717af9cc9b40c8bb61cf3cb15e3b5fe5d209 (patch)
tree0165f36df310e10abde50804437497d802288598 /Library/Homebrew/utils
parent7a0fa34a80ce2fb30154d1ae2d0e9a56eda201c4 (diff)
parent1284f29561d944e069d201db9043489417b85ff4 (diff)
downloadbrew-7077717af9cc9b40c8bb61cf3cb15e3b5fe5d209.tar.bz2
Merge pull request #1637 from broder/mirror_audit
Updated resource auditing to detect invalid mirrors when using --online
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