diff options
author | Chris Larson <clarson@kergoth.com> | 2004-05-22 00:57:22 +0000 |
---|---|---|
committer | Chris Larson <clarson@kergoth.com> | 2004-05-22 00:57:22 +0000 |
commit | 63e2fc7f194063459f1e7e718dbdd14222b592ab (patch) | |
tree | 86e95e6d402d54c8e10d6d391e924a0e5a0f2f67 /bin | |
parent | 2ecc73b853fff8b249d9d782b7138a01b20eb5f8 (diff) | |
download | bitbake-63e2fc7f194063459f1e7e718dbdd14222b592ab.tar.gz |
Bugfix in decodeurl's uri regex; the previous version was losing parm's and chopping off the last char of the host in certain cases.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/oe/__init__.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/bin/oe/__init__.py b/bin/oe/__init__.py index c5bd06872..f5471898a 100644 --- a/bin/oe/__init__.py +++ b/bin/oe/__init__.py @@ -263,16 +263,23 @@ def decodeurl(url): ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', {'tag': 'V0-99-81', 'module': 'familiar/dist/ipkg'}) """ - #m = re.compile('([^:]*):/*(.+@)?([^/]+)(/[^;]+);?(.*)').match(url) - m = re.compile('(?P<type>[^:]*)://((?P<user>.+)@)?((?P<host>[^/]+))?(?P<path>/?[^;]+)(;(?P<parm>.*))?').match(url) + m = re.compile('(?P<type>[^:]*)://((?P<user>.+)@)?(?P<location>[^;]+)(;(?P<parm>.*))?').match(url) if not m: raise MalformedUrl(url) type = m.group('type') - host = m.group('host') - path = m.group('path') + location = m.group('location') + if not location: + raise MalformedUrl(url) user = m.group('user') parm = m.group('parm') + m = re.compile('(?P<host>[^/;]+)(?P<path>/[^;]+)').match(location) + if m: + host = m.group('host') + path = m.group('path') + else: + host = "" + path = location if user: m = re.compile('(?P<user>[^:]+)(:?(?P<pswd>.*))').match(user) if m: @@ -281,13 +288,13 @@ def decodeurl(url): else: user = '' pswd = '' - #debug(3, "decodeurl: %s decoded to:" % url) - #debug(3, "decodeurl: type = '%s'" % type) - #debug(3, "decodeurl: host = '%s'" % host) - #debug(3, "decodeurl: path = '%s'" % path) - #debug(3, "decodeurl: parm = '%s'" % parm) - #debug(3, "decodeurl: user = '%s'" % user) - #debug(3, "decodeurl: pswd = '%s'" % pswd) + #note("decodeurl: %s decoded to:" % url) + #note("decodeurl: type = '%s'" % type) + #note("decodeurl: host = '%s'" % host) + #note("decodeurl: path = '%s'" % path) + #note("decodeurl: parm = '%s'" % parm) + #note("decodeurl: user = '%s'" % user) + #note("decodeurl: pswd = '%s'" % pswd) p = {} if parm: for s in parm.split(';'): |