fetch2/git.py: improve error reporting when an invalid protocol is used
PATCH 1/1 fetch2/git.py: improve error reporting when an invalid protocol is used
When an invalid 'protocol' parameter is used in a git SRC_URI, the error reported was not helpful:
ERROR: Function 'Fetcher failure for URL: 'None'. <environment dump>
fatal: Could not make temporary directory: No such file or directory
So instead check that ud.proto is set to something valid, and if not raise a meaningful ParameterError which explains that the protocol type is the source of the problem.
This fixes bug [YOCTO #1142]
--- lib/bb/fetch2/git.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
lib/bb/fetch2/git.py +3 -0
@@ -88,6 +88,9 @@ class Git(FetchMethod): else: ud.proto = "git" + if not ud.proto in ('git', 'file', 'ssh', 'http', 'https'): + raise bb.fetch2.ParameterError("Invalid protocol type", ud.url) + ud.nocheckout = ud.parm.get("nocheckout","0") == "1" ud.rebaseable = ud.parm.get("rebaseable","0") == "1"
Signature · 1 line
1.7.1
Richard Purdie
AppliedQuoted 7 lines · Scott Garman
When an invalid 'protocol' parameter is used in a git
SRC_URI, the error reported was not helpful:ERROR: Function 'Fetcher failure for URL: 'None'. <environment dump>
fatal: Could not make temporary directory: No such file or directory
Quoted 7 lines
So instead check that ud.proto is set to something valid, and if not raise a meaningful ParameterError which explains that the protocol type is the source of the problem.
This fixes bug [YOCTO #1142]
Signed-off-by Scott Garman <[email protected]>
Merged to master, thanks.
Richard