aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/scriptutils.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-09-19 08:08:11 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-19 09:06:52 +0100
commit78c672a72f49c4b6cfd8c247efcc676b0ba1681a (patch)
treec1218f7f19edb592ca24735b569c2251b977c11b /scripts/lib/scriptutils.py
parentba4aa319fd49ee02ce2e30c2db0f3988c0e8833c (diff)
downloadopenembedded-core-contrib-78c672a72f49c4b6cfd8c247efcc676b0ba1681a.tar.gz
recipetool: create: support git short form URLs
In keeping with making recipetool create / devtool add as easy to use as possible, users shouldn't have to know how to reformat git short form ssh URLs for consumption by BitBake's fetcher (for example user@git.example.com:repo.git should be expressed as git://user@git.example.com/repo.git;protocol=ssh ) - instead we should just take care of that automatically. Add some logic in the appropriate places to do that. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/scriptutils.py')
-rw-r--r--scripts/lib/scriptutils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index bd082d8581..5ccc027968 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -116,3 +116,16 @@ def run_editor(fn):
except OSError as exc:
logger.error("Execution of editor '%s' failed: %s", editor, exc)
return 1
+
+def is_src_url(param):
+ """
+ Check if a parameter is a URL and return True if so
+ NOTE: be careful about changing this as it will influence how devtool/recipetool command line handling works
+ """
+ if not param:
+ return False
+ elif '://' in param:
+ return True
+ elif param.startswith('git@') or ('@' in param and param.endswith('.git')):
+ return True
+ return False