summaryrefslogtreecommitdiff
path: root/morphlib/sysbranchdir.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-03-06 15:53:05 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-03-06 19:25:00 +0000
commitb3a92a22969b5131aacd7294a3105507125cc3ab (patch)
treee977fcb8d65d34e3f32d610f5644182d4bb427be /morphlib/sysbranchdir.py
parenta0fe3ebf760839ac6b95ff888ed79e0b88dd5f0e (diff)
downloadmorph-b3a92a22969b5131aacd7294a3105507125cc3ab.tar.gz
Fix system branch dirname generation to avoid colons
Diffstat (limited to 'morphlib/sysbranchdir.py')
-rw-r--r--morphlib/sysbranchdir.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/morphlib/sysbranchdir.py b/morphlib/sysbranchdir.py
index 1a8b898a..9d96e974 100644
--- a/morphlib/sysbranchdir.py
+++ b/morphlib/sysbranchdir.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2013 Codethink Limited
+# Copyright (C) 2013-2014 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
@@ -74,6 +74,11 @@ class SystemBranchDirectory(object):
If the URL is a real one (not aliased), the schema and leading //
are removed from it, as is a .git suffix.
+ Any colons in the URL path or network location are replaced
+ with slashes, so that directory paths do not contain colons.
+ This avoids problems with PYTHONPATH, PATH, and other things
+ that use colon as a separator.
+
'''
# Parse the URL. If the path component is absolute, we assume
@@ -93,6 +98,9 @@ class SystemBranchDirectory(object):
else:
relative = repo_url
+ # Replace colons with slashes.
+ relative = '/'.join(relative.split(':'))
+
# Remove anyleading slashes, or os.path.join below will only
# use the relative part (since it's absolute, not relative).
relative = relative.lstrip('/')