[Buildroot] wget download: 'scheme missing' results in empty output file
Thomas De Schampheleire
patrickdepinguin at gmail.com
Fri Mar 18 09:43:57 UTC 2016
On Thu, Feb 25, 2016 at 9:32 PM, Yann E. MORIN <yann.morin.1998 at free.fr> wrote:
> Thomas², All,
>
> On 2016-02-25 18:01 +0100, Thomas Petazzoni spake thusly:
>> Dear Peter Korsgaard,
>>
>> On Thu, 25 Feb 2016 17:34:14 +0100, Peter Korsgaard wrote:
>>
>> > > Also, for packages where the source is included with buildroot, like
>> > > makedevs, FOO_SITE is empty too.
>> >
>> > .. but those also don't define _SOURCE / _VERSION, so wget isn't called
>> > ;)
>>
>> Yeah, but I was proposing to check for an empty FOO_SITE in the package
>> infrastructure itself, so we're not at the point where wget gets called.
>
> What about:
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index e22babb..64c6fdc 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -436,7 +436,7 @@ endif
> $(2)_ALL_DOWNLOADS = \
> $$(foreach p,$$($(2)_SOURCE) $$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS),\
> $$(if $$(findstring ://,$$(p)),$$(p),\
> -$$($(2)_SIT E)/$$(p)))
> +$$(if $$($(2)_SITE),$$($(2)_SITE)/$$(p))))
>
> ifndef $(2 )_SITE
> ifdef $(3)_SITE
I tried this, but it does not yield the desired end-result: no file
will be downloaded, the download step 'succeeds', and the extract step
fails because it can't find the expected file.
I found another clean and simple solution to my problem:
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -442,6 +442,8 @@ endif
ifndef $(2)_SITE
ifdef $(3)_SITE
$(2)_SITE = $$($(3)_SITE)
+ else
+ $(2)_SITE = undefined
endif
endif
A similar 'undefined' trick is done to $(2)_VERSION.
Basically, either site is set, or it defaults to 'undefined'.
When a download is not attempted (e.g. source in buildroot, ...) there
is no change, if a download is attempted then it will fail due to
'undefined'.
What do you think?
Thanks,
Thomas
More information about the buildroot
mailing list