summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-10-03 13:27:57 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-03 17:28:53 +0100
commit5bc4930c1638db16bcd5f9c8cfc4081f9ffc192b (patch)
treee364cdb5925b53ac4fc746f5ddbb2fdb42b2f824
parent117b47553970fc5307374cbf500744b7c302efb4 (diff)
downloadbitbake-5bc4930c1638db16bcd5f9c8cfc4081f9ffc192b.tar.gz
fetch2: raise an exception if user specifies protocol=git with http://
It is a common mistake to use http:// and protocol=git when attempting to fetch from a git repository using the http protocol; if this is detected then throw an error explaining that you need to use git:// with protocol=http instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/wget.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index 9affa0da5..ea99198a7 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -49,6 +49,9 @@ class Wget(FetchMethod):
return True
def urldata_init(self, ud, d):
+ if 'protocol' in ud.parm:
+ if ud.parm['protocol'] == 'git':
+ raise bb.fetch2.ParameterError("Invalid protocol - if you wish to fetch from a git repository using http, you need to instead use the git:// prefix with protocol=http", ud.url)
if 'downloadfilename' in ud.parm:
ud.basename = ud.parm['downloadfilename']