summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-03-01 17:23:22 -0500
committerColin Walters <walters@verbum.org>2010-03-01 17:23:22 -0500
commit5ca9f31da121d2d998edf2e70221f16f444d537a (patch)
tree6cb7b05e37c330fc931c6ac2810209cbbfd2e042
parentd5e761791ce4e6b5074317a0f3fc4cd9b399bbcd (diff)
downloadfedpkg-make-pull-5ca9f31da121d2d998edf2e70221f16f444d537a.tar.gz
fedpkg-make-pull-5ca9f31da121d2d998edf2e70221f16f444d537a.tar.xz
fedpkg-make-pull-5ca9f31da121d2d998edf2e70221f16f444d537a.zip
[fedpkg-vcs] Change expected VCS scheme closer to maven
Now require a type in front.
-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,