diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2014-05-12 14:15:31 +0100 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2014-05-12 14:15:31 +0100 |
commit | bbbf5e99399c4c3f5abd85cd203b9863e5aa305c (patch) | |
tree | 41d9c43f8f8f7ccefb6e7aba7fa7d331abec3dd0 /layerindex/models.py | |
parent | f7fa15dd365b8903b608834a536e2b83f3cef289 (diff) | |
download | openembedded-core-contrib-bbbf5e99399c4c3f5abd85cd203b9863e5aa305c.tar.gz |
Handle % characters in URLs
If there is a % character in the path to a file / directory, we need to
properly encode it when creating the repo web URL or the link won't
work. Thanks to Khem Raj for reporting this.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/models.py')
-rw-r--r-- | layerindex/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/layerindex/models.py b/layerindex/models.py index 1f239033da..17bf8d516e 100644 --- a/layerindex/models.py +++ b/layerindex/models.py @@ -143,6 +143,11 @@ class LayerBranch(models.Model): else: branchname = self.branch.name url = base_url.replace('%branch%', branchname) + + # If there's a % in the path (e.g. a wildcard bbappend) we need to encode it + if extra_path: + extra_path = extra_path.replace('%', '%25') + if '%path%' in base_url: if extra_path: url = re.sub(r'\[([^\]]*%path%[^\]]*)\]', '\\1', url) |