diff options
Diffstat (limited to 'morphlib/sourcemanager.py')
-rw-r--r-- | morphlib/sourcemanager.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/morphlib/sourcemanager.py b/morphlib/sourcemanager.py index 11d891de..926f1d0d 100644 --- a/morphlib/sourcemanager.py +++ b/morphlib/sourcemanager.py @@ -30,11 +30,17 @@ urlparse.uses_params.extend(gitscheme) urlparse.uses_query.extend(gitscheme) urlparse.uses_fragment.extend(gitscheme) -_valid_chars = string.digits + string.letters + ':%_' - def quote_url(url): - transl = lambda x: x if x in _valid_chars else '_' + ''' Convert URIs to strings that only contain digits, letters, % and _. + + NOTE: When changing the code of this function, make sure to also apply + the same to the quote_url() function of lorry. Otherwise the git bundles + generated by lorry may no longer be found by morph. + + ''' + valid_chars = string.digits + string.letters + '%_' + transl = lambda x: x if x in valid_chars else '_' return ''.join([transl(x) for x in url]) @@ -81,7 +87,6 @@ class SourceManager(object): t = urlparse.urlparse(url) path = t[2] basename = os.path.basename(path) - basename = '_'.join(basename.split(':')) saved_name = os.path.join(self.cache_dir, basename) source_handle = urllib2.urlopen(url) |