diff mbox

[OpenWrt-Devel] include: download.mk: If checkouts fail, attempt default download method

Message ID 1442347262-7530-1-git-send-email-psidhu@gateworks.com
State Rejected
Headers show

Commit Message

Pushpal Sidhu Sept. 15, 2015, 8:01 p.m. UTC
This will allow a more robust download system, especially in cases when
building an older release where a source checkout system is gone.

Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
---
 include/download.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

John Crispin Sept. 16, 2015, 8:26 a.m. UTC | #1
On 15/09/2015 22:01, Pushpal Sidhu wrote:
> This will allow a more robust download system, especially in cases when
> building an older release where a source checkout system is gone.
> 
> Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>

although this looks good at first glance we notice on a closer
inspection that the DL will happen without the md5 check and o on.

sorry, cant merge it like that.






> ---
>  include/download.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/download.mk b/include/download.mk
> index adaa2e6..eb86faf 100644
> --- a/include/download.mk
> +++ b/include/download.mk
> @@ -46,7 +46,7 @@ define DownloadMethod/default
>  endef
>  
>  define wrap_mirror
> -	$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" || ( $(1) ),$(1))
> +	$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" || ( $(1) ), ( $(1) ) || $(DownloadMethod/default))
>  endef
>  
>  define DownloadMethod/cvs
>
Pushpal Sidhu Sept. 16, 2015, 3:08 p.m. UTC | #2
Hi,

On Wed, Sep 16, 2015 at 1:26 AM, John Crispin <blogic@openwrt.org> wrote:
>
>
> On 15/09/2015 22:01, Pushpal Sidhu wrote:
>> This will allow a more robust download system, especially in cases when
>> building an older release where a source checkout system is gone.
>>
>> Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
>
> although this looks good at first glance we notice on a closer
> inspection that the DL will happen without the md5 check and o on.
>
> sorry, cant merge it like that.

After thinking about it, I understand what you're saying. Unless a
package defines a mirror md5sum, in which case the wrap_mirror
function already takes care of it.

I find that when packages define a mirror md5sum, wrap_mirror checks
mirror sites before using the preferred method of download by the
package. This leads to many packages commenting out the mirror md5sum
(or worse, omit it's inclusion all together) because they don't want
to burden mirror sites (especially the two openwrt defaults). Until an
individual manually patches every package as sources become obsolete,
this will remain a problem, but that's not always easy for some
people, plus can be a distribution nightmare in some cases (maybe
github will change it's name and everyone on 14.07 and before will
start having huge issues when building until patched).

How about a patch that instead uses the default source method (e.g.
git checkout), then checks against mirrors? I'm not sure of the
original reasoning for deciding this, but please consider changing the
behavior of this. This will have the affect of packages starting to
use the mirror md5sum more readily, won't burden sites that mirror
packages until a source has been obsoleted, and is easier than
manually editing each package that goes down. It just seems that there
is an inconsistency with how download.mk handles mirrors vs. how
package maintainers handle it.

- Pushpal
diff mbox

Patch

diff --git a/include/download.mk b/include/download.mk
index adaa2e6..eb86faf 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -46,7 +46,7 @@  define DownloadMethod/default
 endef
 
 define wrap_mirror
-	$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" || ( $(1) ),$(1))
+	$(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" || ( $(1) ), ( $(1) ) || $(DownloadMethod/default))
 endef
 
 define DownloadMethod/cvs