aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2010-01-06 23:38:07 +0000
committerMax Howell2010-01-06 23:38:07 +0000
commitd9dc06a0a7e276d504836091b8edd50cb9df10d0 (patch)
tree971f5f234a8e4ae955a082a830f431fb94a8ef13 /Library
parent02bcdd1cbd80d385579385bcc435cb468205f91c (diff)
downloadhomebrew-d9dc06a0a7e276d504836091b8edd50cb9df10d0.tar.bz2
Check GitHub for issues relating to build failures
Uses the GitHub issue search API, so it's very neat and concise. However you can get false positives, so it's not 100% useful. Still I think it is more useful than before, which was, nothing. A further issue is it depends on the ticket at GitHub using the formula's proper name. So we should ensure this as we can. Finally, it does add a possibly large delay to clean exit after a build error. We may want to fiddle with timeouts if it becomes troublesome.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 774ea8093..2ae9ed669 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -212,6 +212,28 @@ rescue FormulaUnavailableError
end
end
+def issues_for_formula name
+ # bit basic as depends on the issue at github having the exact name of the
+ # formula in it. Which for stuff like objective-caml is unlikely. So we
+ # really should search for aliases too.
+
+ name = f.name if Formula === name
+
+ require 'open-uri'
+ require 'yaml'
+
+ issues = []
+
+ open("http://github.com/api/v2/yaml/issues/search/mxcl/homebrew/open/"+name) do |f|
+ YAML::load(f.read)['issues'].each do |issue|
+ issues << 'http://github.com/mxcl/homebrew/issues/#issue/%s' % issue['number']
+ end
+ end
+
+ issues
+rescue
+ []
+end
def clean f
Cleaner.new f