All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/9 v2] pkg-infra: differentiate remote tarball name from local filename
Date: Sat, 6 Dec 2014 16:08:21 +0100	[thread overview]
Message-ID: <20141206150821.GD9544@free.fr> (raw)
In-Reply-To: <CAHXCMMKcCtD0iK1ooZyLH93cquSXH-u0e=m4OTM+K+EVMuDbaQ@mail.gmail.com>

Samuel, All,

On 2014-12-06 14:28 +0100, Samuel Martin spake thusly:
> On Sat, Dec 6, 2014 at 12:13 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > Some upstreams may use a naming scheme that does not fit well in how
> > Buildroot wants to handle filenames.
> >
> > For example, GitHub used to have a scheme like:
> >     https://github.com/USER/REPO/archive/VERSION.tar.gz
> >
> > which means we would have a local file named VERSION.tar.gz, when we
> > want to have PKG-VERSION.tar.gz
> >
> > Other forges are also known to have similar schemes. Google Code, for
> > example, may also use similarly named files.
> >
> > Introduce a new variable, FOO_UPSTREAM_SOURCE, which the package may set
> > in that case. If not set, it defaults to FOO_SOURCE.
> 
> I wonder how it will play when download falls back on
> http://sources.buildroot.net/, I mean what will be the tarball
> filename uploaded on s.b.n? Will it be FOO_UPSTREAM_SOURCE or
> FOO_SOURCE?
> 
> Afaics, FOO_SOURCE will be uploaded on s.b.n, whereas the fallback url will be:
>   http://sources.buildroot.net/$(FOO_UPSTREAM_SOURCE)

I don't think so.

As far as I can see, we're doing:

    # Argument 1 is the source location
    # Argument 2 is the local filename, optional [...]
    define DOWNLOAD
        $(call DOWNLOAD_INNER,$(1),$(if $(2),$(2),$(notdir $(1))))
    endef

So, we have two cases:
  - upstream and local filenames differ: the second argument is the
    local filename
  - upstream and local filenames are the same: the second argument is
    empty, and defaults to the upstream filename

So, we always end up calling DOWNLOAD_INNER with the local filename as
second argument. Then,

    define DOWNLOAD_INNER
        [...]
        if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
            $(call $(DL_MODE)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) && exit ; \
        fi ; \
        [...]
    endef

So, we're fetching $(2) from the backup site. And $(2) is the local
filename.

Ergo, the fallback site case is covered. :-)

Pfeww, you made me doubt for a moment, and I was afraid I'd have to
rework the whole series entirely. Not the case, Hehe! ;-p

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2014-12-06 15:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-06 11:13 [Buildroot] [PATCH 0/9 v2] pkg-infra: better github handling, download enhancements (branch yem/download) Yann E. MORIN
2014-12-06 11:13 ` [Buildroot] [PATCH 1/9 v2] pkg-infra: allow specifying the local tarball name when calling DOWNLOAD Yann E. MORIN
2014-12-06 11:13 ` [Buildroot] [PATCH 2/9 v2] pkg-infra: differentiate remote tarball name from local filename Yann E. MORIN
2014-12-06 13:28   ` Samuel Martin
2014-12-06 15:08     ` Yann E. MORIN [this message]
2014-12-06 11:13 ` [Buildroot] [PATCH 3/9 v2] docs/manual: document the new variable FOO_UPSTREAM_SOURCE Yann E. MORIN
2014-12-06 11:13 ` [Buildroot] [PATCH 4/9 v2] pkg-infra: add support for GitHub as a forge Yann E. MORIN
2014-12-06 11:13 ` [Buildroot] [PATCH 5/9 v2] pkg-infra: add support for Gitorious " Yann E. MORIN
2014-12-06 11:13 ` [Buildroot] [PATCH 6/9 v2] docs/manual: document the new forges we support: github and gitorious Yann E. MORIN
2014-12-06 11:13 ` [Buildroot] [PATCH 7/9 v2] packages: switch to using the github forge Yann E. MORIN
2014-12-06 11:13 ` [Buildroot] [PATCH 8/9 v2] packages: switch to using the gitorious forge Yann E. MORIN
2014-12-06 11:13 ` [Buildroot] [PATCH 9/9 v2] pkg-infra: remove the legacy github helper Yann E. MORIN

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=20141206150821.GD9544@free.fr \
    --to=yann.morin.1998@free.fr \
    --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 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.