* [PATCH] fetch2: raise an exception if user specifies protocol=git with http://
@ 2012-10-03 12:27 Paul Eggleton
2012-10-06 22:27 ` Chris Larson
0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2012-10-03 12:27 UTC (permalink / raw)
To: bitbake-devel
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>
---
bitbake/lib/bb/fetch2/wget.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 9affa0d..ea99198 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/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']
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fetch2: raise an exception if user specifies protocol=git with http://
2012-10-03 12:27 [PATCH] fetch2: raise an exception if user specifies protocol=git with http:// Paul Eggleton
@ 2012-10-06 22:27 ` Chris Larson
2012-10-06 22:32 ` Paul Eggleton
0 siblings, 1 reply; 5+ messages in thread
From: Chris Larson @ 2012-10-06 22:27 UTC (permalink / raw)
To: Paul Eggleton; +Cc: bitbake-devel
On Wed, Oct 3, 2012 at 5:27 AM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> 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>
Perhaps this should check the protocol= value against the protocols
supported by wget (ftp, http, https, etc), if the parameter is passed,
rather than hardcoding the exceptions.
--
Christopher Larson
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fetch2: raise an exception if user specifies protocol=git with http://
2012-10-06 22:27 ` Chris Larson
@ 2012-10-06 22:32 ` Paul Eggleton
2012-10-06 22:38 ` Chris Larson
0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2012-10-06 22:32 UTC (permalink / raw)
To: Chris Larson; +Cc: bitbake-devel
On Saturday 06 October 2012 15:27:42 Chris Larson wrote:
> On Wed, Oct 3, 2012 at 5:27 AM, Paul Eggleton
>
> <paul.eggleton@linux.intel.com> wrote:
> > 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>
>
> Perhaps this should check the protocol= value against the protocols
> supported by wget (ftp, http, https, etc), if the parameter is passed,
> rather than hardcoding the exceptions.
I don't think protocol= is currently used with the wget fetcher is it?
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fetch2: raise an exception if user specifies protocol=git with http://
2012-10-06 22:32 ` Paul Eggleton
@ 2012-10-06 22:38 ` Chris Larson
2012-10-07 20:03 ` Paul Eggleton
0 siblings, 1 reply; 5+ messages in thread
From: Chris Larson @ 2012-10-06 22:38 UTC (permalink / raw)
To: Paul Eggleton; +Cc: bitbake-devel
On Sat, Oct 6, 2012 at 3:32 PM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> On Saturday 06 October 2012 15:27:42 Chris Larson wrote:
>> On Wed, Oct 3, 2012 at 5:27 AM, Paul Eggleton
>>
>> <paul.eggleton@linux.intel.com> wrote:
>> > 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>
>>
>> Perhaps this should check the protocol= value against the protocols
>> supported by wget (ftp, http, https, etc), if the parameter is passed,
>> rather than hardcoding the exceptions.
>
> I don't think protocol= is currently used with the wget fetcher is it?
It isn't, but it also doesn't seem ideal to hardcode knowledge of the
git fetcher in the wget one. Either way, I just wanted to make sure
both options were considered.
--
Christopher Larson
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fetch2: raise an exception if user specifies protocol=git with http://
2012-10-06 22:38 ` Chris Larson
@ 2012-10-07 20:03 ` Paul Eggleton
0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2012-10-07 20:03 UTC (permalink / raw)
To: Chris Larson; +Cc: bitbake-devel
On Saturday 06 October 2012 15:38:45 Chris Larson wrote:
> On Sat, Oct 6, 2012 at 3:32 PM, Paul Eggleton
> <paul.eggleton@linux.intel.com> wrote:
> > On Saturday 06 October 2012 15:27:42 Chris Larson wrote:
> >> On Wed, Oct 3, 2012 at 5:27 AM, Paul Eggleton
> >>
> >> <paul.eggleton@linux.intel.com> wrote:
> >> > 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>
> >>
> >> Perhaps this should check the protocol= value against the protocols
> >> supported by wget (ftp, http, https, etc), if the parameter is passed,
> >> rather than hardcoding the exceptions.
> >
> > I don't think protocol= is currently used with the wget fetcher is it?
>
> It isn't, but it also doesn't seem ideal to hardcode knowledge of the
> git fetcher in the wget one. Either way, I just wanted to make sure
> both options were considered.
I did consider checking for any use of protocol= and failing if any value is
specified; perhaps we should still do that; for the purposes of helping people
avoid a common pitfall however, it seems reasonable to me to check explicitly
for protocol=git and I would still advocate leaving that check and message in
even if we did add a general check on protocol.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-10-07 20:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-03 12:27 [PATCH] fetch2: raise an exception if user specifies protocol=git with http:// Paul Eggleton
2012-10-06 22:27 ` Chris Larson
2012-10-06 22:32 ` Paul Eggleton
2012-10-06 22:38 ` Chris Larson
2012-10-07 20:03 ` Paul Eggleton
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.