Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Seiderer <ps.report@gmx.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 09/13] pkg-download: support new subdir for mirrors
Date: Fri, 27 Oct 2017 20:14:46 +0200	[thread overview]
Message-ID: <20171027201446.0457eccd@gmx.net> (raw)
In-Reply-To: <5dd5ec31-1c3c-3c6b-d422-e0714399534d@mind.be>

Hello Arnout,

On Mon, 23 Oct 2017 21:49:39 +0200, Arnout Vandecappelle <arnout@mind.be> wrote:

> On 04-07-17 18:22, Maxime Hadjinlian wrote:
> > Since we introduced subdirectory to the DL_DIR, we need to support them  
>                       subdirectories
> 
> > in the PRIMARY and BACKUP mirror as they evolve to the new tree
> > structure.
> > 
> > We check first the new URI (with the subdir), and in case of failure, we
> > go check without.
> > By checking both URIs, we ensure that old mirror are usable.  
>                                             mirrors
> 
> > 
> > Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.co> ---
> >  package/pkg-download.mk | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/package/pkg-download.mk b/package/pkg-download.mk
> > index 9a455dc79b..47671e21a7 100644
> > --- a/package/pkg-download.mk
> > +++ b/package/pkg-download.mk
> > @@ -75,6 +75,7 @@ export BR_NO_CHECK_HASH_FOR =
> >  
> >  ifneq ($(call qstrip,$(BR2_PRIMARY_SITE)),)
> >  DOWNLOAD_URIS += \
> > +	-u $(call getschemeplusuri,$(BR2_PRIMARY_SITE))/$(notdir $($(PKG)_DL_DIR)) \  
> 
>  I was thinking, it is a bit silly to first calculate that path and then
> applying notdir to it, but I guess this is more robust to a change of PKG_DL_DIR.
> 
>  There is just one thing to check: I think that this DOWNLOAD_URIS may also be
> used outside the context of a package, in which case $(PKG) is not defined. It's
> not terrible because then we just go to PRIMARY_SITE without subdir, but it's a
> pity to do things twice. So maybe better
> 
> 	$(if $(PKG),$(call getschemeplusuri,$(BR2_PRIMARY_SITE))/$(notdir $($(PKG)_DL_DIR))) \
> 
>  Oh yeah, completely easy to read :-)

The original line changed in Maxims latest patchset to:

	-u $(call getschemeplusuri,$(BR2_PRIMARY_SITE)/$(notdir $($(PKG)_DL_DIR)),urlencode) \

would the following line be the correct improved change?

	-u $(if $(PKG),$(call getschemeplusuri,$(BR2_PRIMARY_SITE)/$(notdir $($(PKG)_DL_DIR)),urlencode)) \

Regards,
Peter

> 
>  Regards,
>  Arnout
> 
> >  	-u $(call getschemeplusuri,$(BR2_PRIMARY_SITE))
> >  endif
> >  
> > @@ -83,6 +84,7 @@ DOWNLOAD_URIS += \
> >  	-u $($(PKG)_SITE_METHOD)+$(dir $(1))
> >  ifneq ($(call qstrip,$(BR2_BACKUP_SITE)),)
> >  DOWNLOAD_URIS += \
> > +	-u $(call getschemeplusuri,$(BR2_BACKUP_SITE))/$(notdir $($(PKG)_DL_DIR)) \
> >  	-u $(call getschemeplusuri,$(BR2_BACKUP_SITE))
> >  endif
> >  endif
> >   
> 

  reply	other threads:[~2017-10-27 18:14 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 16:21 [Buildroot] [PATCH 00/13] New DL_DIR organisation; git cache feature Maxime Hadjinlian
2017-07-04 16:21 ` [Buildroot] [PATCH 01/13] pkg-{download, generic}: remove source-check Maxime Hadjinlian
2017-07-04 17:37   ` Thomas Petazzoni
2017-07-04 16:22 ` [Buildroot] [PATCH 02/13] core/pkg-download: change all helpers to use common options Maxime Hadjinlian
2017-07-04 23:09   ` Arnout Vandecappelle
2017-07-04 23:14     ` Yann E. MORIN
2017-07-05  0:38       ` Arnout Vandecappelle
2017-07-05  7:09         ` Yann E. MORIN
2017-07-04 16:22 ` [Buildroot] [PATCH 03/13] download: put most of the infra in dl-wrapper Maxime Hadjinlian
2017-07-05  0:32   ` Arnout Vandecappelle
2017-07-04 16:22 ` [Buildroot] [PATCH 04/13] pkg-generic: make PKG_DL_DIR equal to DL_DIR Maxime Hadjinlian
2017-07-05  8:30   ` Arnout Vandecappelle
2017-07-22 21:37   ` Thomas Petazzoni
2017-07-04 16:22 ` [Buildroot] [PATCH 05/13] packages: use new $($PKG)_DL_DIR) variable Maxime Hadjinlian
2017-07-22 21:39   ` Thomas Petazzoni
2017-07-22 21:54     ` Yann E. MORIN
2017-10-23 20:00   ` Arnout Vandecappelle
2017-07-04 16:22 ` [Buildroot] [PATCH 06/13] pkg-{download, generic}: use new $($(PKG)_DL_DIR) Maxime Hadjinlian
2017-07-04 16:22 ` [Buildroot] [PATCH 07/13] support/download: make sure the download folder is created Maxime Hadjinlian
2017-07-04 16:22 ` [Buildroot] [PATCH 08/13] pkg-generic: add a subdirectory to the DL_DIR Maxime Hadjinlian
2017-10-23 19:42   ` Arnout Vandecappelle
2017-07-04 16:22 ` [Buildroot] [PATCH 09/13] pkg-download: support new subdir for mirrors Maxime Hadjinlian
2017-10-23 19:49   ` Arnout Vandecappelle
2017-10-27 18:14     ` Peter Seiderer [this message]
2017-07-04 16:22 ` [Buildroot] [PATCH 10/13] pkg-generic: introduce _SAME_SOURCE_AS Maxime Hadjinlian
2017-10-23 19:55   ` Arnout Vandecappelle
2017-10-23 23:09     ` Yann E. MORIN
2017-07-04 16:22 ` [Buildroot] [PATCH 11/13] help/manual: update help about the new $(LIBFOO_DL_DIR) Maxime Hadjinlian
2017-10-23 20:04   ` Arnout Vandecappelle
2017-07-04 16:22 ` [Buildroot] [PATCH 12/13] download: add flock call before dl-wrapper Maxime Hadjinlian
2017-10-23 20:17   ` Arnout Vandecappelle
2017-07-04 16:22 ` [Buildroot] [PATCH 13/13] download: git: introduce cache feature Maxime Hadjinlian
2017-10-27 18:28   ` Peter Seiderer
2017-10-28 16:55     ` Arnout Vandecappelle
2017-07-27 22:37 ` [Buildroot] [PATCH 00/13] New DL_DIR organisation; git " Peter Seiderer
2017-07-30 16:32   ` Maxime Hadjinlian
2017-10-17 19:56     ` Peter Seiderer
2017-10-23 18:24       ` Maxime Hadjinlian
2017-10-23 18:42         ` Arnout Vandecappelle
2017-10-23 19:03           ` Maxime Hadjinlian
2017-10-25 20:02             ` Peter Seiderer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171027201446.0457eccd@gmx.net \
    --to=ps.report@gmx.net \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox