All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fetch2/git.py: improve error reporting when an invalid protocol is used
@ 2011-06-19 23:15 Scott Garman
  2011-06-22 15:25 ` Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Garman @ 2011-06-19 23:15 UTC (permalink / raw)
  To: bitbake-devel; +Cc: 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

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 <scott.a.garman@intel.com>
---
 lib/bb/fetch2/git.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 6979bea..f3bc793 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -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"
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fetch2/git.py: improve error reporting when an invalid protocol is used
  2011-06-19 23:15 [PATCH] fetch2/git.py: improve error reporting when an invalid protocol is used Scott Garman
@ 2011-06-22 15:25 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2011-06-22 15:25 UTC (permalink / raw)
  To: Scott Garman; +Cc: bitbake-devel

On Sun, 2011-06-19 at 16:15 -0700, Scott Garman wrote:
> 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]
> 
> Signed-off-by: Scott Garman <scott.a.garman@intel.com>

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-22 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-19 23:15 [PATCH] fetch2/git.py: improve error reporting when an invalid protocol is used Scott Garman
2011-06-22 15:25 ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.