path: root/scripts
diff options
authorMing Liu <>2018-04-01 23:15:27 +0200
committerRichard Purdie <>2018-04-03 10:57:50 +0100
commit4290e04b69360b5e1da9f37166015e30f66cb335 (patch)
tree4148d19eec97af24fe649ac96c8595060190d09c /scripts
parentae230e1f858f83d1ff063554b49bd3ee1f880f76 (diff)
recipetool: create: fix port number parsing issue
A flaw was found when I run: $ recipetool create "ssh://" the url turned out to be: "git://;protocol=ssh" after parsing, the port number was parsed as part of the path, this is definitely wrong and lead to fetching failures. This issue could be fixed in reformat_git_uri, by filtering out port numbers when formatting ":". Signed-off-by: Ming Liu <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'scripts')
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/ b/scripts/lib/recipetool/
index 2fc9e0aa4e..a3710285bb 100644
--- a/scripts/lib/recipetool/
+++ b/scripts/lib/recipetool/
@@ -383,8 +383,10 @@ def reformat_git_uri(uri):
# which causes decodeurl to fail getting the right host and path
if len(host.split(':')) > 1:
splitslash = host.split(':')
- host = splitslash[0]
- path = '/' + splitslash[1] + path
+ # Port number should not be split from host
+ if not re.match('^[0-9]+$', splitslash[1]):
+ host = splitslash[0]
+ path = '/' + splitslash[1] + path
# if user is defined, append protocol=ssh or if a protocol is defined, then honor the user-defined protocol
# if no user & password is defined, check for scheme type and append the protocol with the scheme type