Import support for bare git:// protocol

This commit is contained in:
Ciaran Gultnieks 2012-04-03 21:13:51 +01:00
parent c8b7406094
commit 95575ede22
2 changed files with 12 additions and 2 deletions

View file

@ -346,11 +346,14 @@ Google Code - @code{http://code.google.com/p/PROJECT/}
(supports git, svn and hg repos) (supports git, svn and hg repos)
@item @item
Bitbucket - @code{https://bitbucket.org/USER/PROJECT/} Bitbucket - @code{https://bitbucket.org/USER/PROJECT/}
@item
Git - @code{git://REPO}
@end enumerate @end enumerate
Depending on the project type, more or less information may be gathered. For Depending on the project type, more or less information may be gathered. For
example, the license will be retrieved from a Google Code project, but not a example, the license will be retrieved from a Google Code project, but not a
GitHub one. GitHub one. A bare repo url, such as the git:// one, is the least preferable
optional of all, since you will have to enter much more information manually.
If the import is successful, a metadata file will be created. You will need to If the import is successful, a metadata file will be created. You will need to
edit this further to check the information, and fill in the blanks. edit this further to check the information, and fill in the blanks.

View file

@ -57,6 +57,13 @@ def main():
projecttype = None projecttype = None
issuetracker = None issuetracker = None
license = None license = None
website = url #by default, we might override it
if url.startswith('git://'):
projecttype = 'git'
repo = url
repotype = 'git'
sourcecode = ""
website = ""
if url.startswith('https://github.com'): if url.startswith('https://github.com'):
if url.endswith('/'): if url.endswith('/'):
url = url[:-1] url = url[:-1]
@ -211,7 +218,7 @@ def main():
# Construct the metadata... # Construct the metadata...
app = common.parse_metadata(None) app = common.parse_metadata(None)
app['id'] = package app['id'] = package
app['Web Site'] = url app['Web Site'] = website
app['Source Code'] = sourcecode app['Source Code'] = sourcecode
if issuetracker: if issuetracker:
app['Issue Tracker'] = issuetracker app['Issue Tracker'] = issuetracker