summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfedpkg-vcs13
1 files changed, 10 insertions, 3 deletions
diff --git a/fedpkg-vcs b/fedpkg-vcs
index 3b73fff..f008916 100755
--- a/fedpkg-vcs
+++ b/fedpkg-vcs
@@ -63,14 +63,21 @@ class Vcs(object):
subprocess.check_call(*args, **kwargs)
@classmethod
- def new_from_url(cls, url):
+ def new_from_spec(cls, spec):
+ """See http://maven.apache.org/scm/scm-url-format.html ; we use this format,
+ but without the "scm:" prefix."""
+ # Hack for backwards compatibility
+ if spec.startswith('git://'):
+ (vcstype, url) = ('git', spec)
+ else:
+ (vcstype, url) = spec.split(':', 1)
orig = urlparse.urlsplit(url)
# We want to support fragments, even if the URL type isn't recognized. So change the
# scheme to http temporarily.
temp = urlparse.urlunsplit(('http', orig.netloc, orig.path, orig.query, orig.fragment))
new = urlparse.urlsplit(temp)
combined = urlparse.SplitResult(orig.scheme, new.netloc, new.path, new.query, new.fragment)
- if combined.scheme == 'git':
+ if vcstype == 'git':
return GitVcs(combined)
class GitVcs(Vcs):
@@ -453,7 +460,7 @@ def main():
sys.stderr.write(unicode(e) + '\n')
sys.exit(1)
- vcs = Vcs.new_from_url(vcsurl)
+ vcs = Vcs.new_from_spec(vcsurl)
vcsdir = '%s.%s' % (spec.get_name(), vcs.get_scheme())
opts = {'force': force,