1
0
mirror of https://github.com/golang/go synced 2024-11-22 04:54:42 -07:00

misc/godashboard: Accept sub-directories for goinstall's report.

Fixed issue 1155.

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/4592059
This commit is contained in:
Yasuhiro Matsumoto 2011-06-20 14:46:32 +10:00 committed by Andrew Gerrand
parent f3a7dad654
commit b7b8f2b086

View File

@ -45,7 +45,7 @@ class Project(db.Model):
re_bitbucket = re.compile(r'^bitbucket\.org/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+$') re_bitbucket = re.compile(r'^bitbucket\.org/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+$')
re_googlecode = re.compile(r'^[a-z0-9\-]+\.googlecode\.com/(svn|hg)$') re_googlecode = re.compile(r'^[a-z0-9\-]+\.googlecode\.com/(svn|hg)$')
re_github = re.compile(r'^github\.com/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+$') re_github = re.compile(r'^github\.com/[a-z0-9A-Z_.\-]+(/[a-z0-9A-Z_.\-]+)+$')
re_launchpad = re.compile(r'^launchpad\.net/([a-z0-9A-Z_.\-]+(/[a-z0-9A-Z_.\-]+)?|~[a-z0-9A-Z_.\-]+/(\+junk|[a-z0-9A-Z_.\-]+)/[a-z0-9A-Z_.\-]+)(/[a-z0-9A-Z_.\-/]+)?$') re_launchpad = re.compile(r'^launchpad\.net/([a-z0-9A-Z_.\-]+(/[a-z0-9A-Z_.\-]+)?|~[a-z0-9A-Z_.\-]+/(\+junk|[a-z0-9A-Z_.\-]+)/[a-z0-9A-Z_.\-]+)(/[a-z0-9A-Z_.\-/]+)?$')
@ -54,10 +54,9 @@ def vc_to_web(path):
check_url = 'http://' + path + '/?cmd=heads' check_url = 'http://' + path + '/?cmd=heads'
web = 'http://' + path + '/' web = 'http://' + path + '/'
elif re_github.match(path): elif re_github.match(path):
# github doesn't let you fetch the .git directory anymore. m = re_github_web.match(path)
# fetch .git/info/refs instead, like git clone would. check_url = 'https://raw.github.com/' + m.group(1) + '/' + m.group(2) + '/master/'
check_url = 'http://'+path+'.git/info/refs' web = 'http://github.com/' + m.group(1) + '/' + m.group(2)
web = 'http://' + path
elif re_googlecode.match(path): elif re_googlecode.match(path):
check_url = 'http://'+path check_url = 'http://'+path
web = 'http://code.google.com/p/' + path[:path.index('.')] web = 'http://code.google.com/p/' + path[:path.index('.')]