From f94f0330eb1d4011868910a0f7234559e48ceff7 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Fri, 4 Mar 2016 12:32:17 +0000 Subject: Add small python library for common(ish) code in scripts/ Change-Id: I74ab24ecdcda1c358a2c187f89685bdd8f949c55 --- scripts/organize-morphologies.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'scripts/organize-morphologies.py') diff --git a/scripts/organize-morphologies.py b/scripts/organize-morphologies.py index abc8c739..3072c8f8 100755 --- a/scripts/organize-morphologies.py +++ b/scripts/organize-morphologies.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (C) 2014 Codethink Limited +# Copyright (C) 2014-2016 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,17 +42,6 @@ which has been moved. ''' -# NOTE: The following reimplements part of morphlib's remote repo cache stuff -def parse_repo_alias(repo): - domain, path = repo.split(':') - if domain == 'baserock': - repo = 'ssh://git@git.baserock.org/baserock/%s' % path - elif domain == 'upstream': - repo = 'ssh://git@git.baserock.org/delta/%s' % path - else: - raise Exception("I don't know how to parse the repo-alias \"%s\"" % repo) - return repo - def make_request(path): server_url = 'http://git.baserock.org:8080/' url = urlparse.urljoin(server_url, '/1.0/%s' % path) @@ -206,7 +195,7 @@ def download_chunks(morph, loader): else: raise err ref = chunk['ref'] - repo = parse_repo_alias(chunk['repo']) + repo = scriptslib.parse_repo_alias(chunk['repo']) try: print "\nDownloading %s from %s into %s" %(name, repo, chunk['morph']) chunk_str = cat_file(repo, ref, name) -- cgit v1.2.1