public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: David Haller <gentoo@dhaller.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: What is the meaning of "mirror" URI scheme in ebuilds?
Date: Wed, 28 Mar 2018 02:36:57 +0200	[thread overview]
Message-ID: <20180328003657.4hklfioudleyc2cn@grusum.endjinn.de> (raw)
In-Reply-To: <20180327222312.erprykdjlfqnin7n@matica.foolinux.mooo.com>

Hello,

On Tue, 27 Mar 2018, Ian Zimmerman wrote:
>On 2018-03-27 22:00, David Haller wrote:
>
>> So, using your example, portage looks up the mirror for mirror://gnu
>> by looking in /etc/portage/mirrors (if it exists) and
>> /usr/portage/profiles/thirdpartymirrors for a line with the word "gnu"
>> at the beginning, and then tries the mirrors specified there. I.e.:
>
>Thanks, this helps.  I have a related follow-up question.
>
>Sometimes, the SRC_URI in fact consists of multiple URIs.  What is
>confusing about that is that in some cases the individual URI clearly
>refer to copies of the same file (I'm guessing this provides redundant
>locations where to download it from),

Yes.

>while in other cases they're clearly different files (for example
>upstream patches to be downloaded separately). There are even ebuilds
>when _both_ cases happen at the same time, such as
>media-libs/freetype-2.9 :
>
>SRC_URI="mirror://sourceforge/freetype/${P/_/}.tar.bz2
>        mirror://nongnu/freetype/${P/_/}.tar.bz2
>        utils?  ( mirror://sourceforge/freetype/ft2demos-${PV}.tar.bz2
>                mirror://nongnu/freetype/ft2demos-${PV}.tar.bz2 )
>        doc?    ( mirror://sourceforge/freetype/${PN}-doc-${PV}.tar.bz2
>                mirror://nongnu/freetype/${PN}-doc-${PV}.tar.bz2 )"
>
>So, WTH is the semantics of this?  How does portage know which URIs are
>for the main tarball and which are the extras?  It has to know that to
>avoid downloading the main tarball twice.

I, too, am not sure how that's handled in portage, much less what the
spec (PMS) say about it, but practical observation leads me to
believe, that for each $(basename $URI) (i.e. each file), portage
tries to get them from the URIs specified, in this case, it tries to
get the freetype ${P/_/}.tar.bz2 tarball from a mirror specified in
the sourceforge or nongnu lists of /etc/portage/mirrors resp. 
${PORTAGE_DIR}/profiles/thirdpartymirrors and then the ft2demos and
-doc- tarballs from (in this case) the same mirror-lists.

Basically, it seems portage build a list of (think '$(basename $URI)')

    file_to_get -> mirrorlist_or_direct_URI

i.e. here:

    freetype-${VER}.tar.bz2     -> URI_LIST
    ft2demos-${VER}.tar.bz2     -> URI_LIST
    freetype-doc-${VER}.tar.bz2 -> URI_LIST

and for each of those it tries the specified URIs (here
mirror://sourceforge and mirror://nongnu mirrorlists). You quite often
also see a "direct" non-mirror:// URI at the end (as a "last resort"
or so).

Anyway, that's my take on it.

And yes (referring to the bug mentioned by Michael in his answer),
quite some mirrors in the (current) thirdpartymirrors list are
outdated, which is why I copied that to /etc/portage/mirrors and
massaged those mirrorlists I noticed "broken" or "slow", either adding
my favored mirrors up front or replacing the complete list with some
chosen "known-good" mirrors.

But for the most-used mirror:// URIs in ebuilds I've come across,
besides the core gentoo list, it's mainly sourceforge or gnu or so. 
For the core "gentoo" mirrors, you can manage that mirrorlist via the
GENTOO_MIRRORS="" variable in make.conf, manually or via mirrorselect.

For me, it's rather easy, there's some "big", reliable "local" mirrors
(mostly at universities and related institutions) that mirror most
opensource software, from core projects (kernel, gnu) and various
projects (X, CTAN, CPAN) to various distros (SuSE, Gentoo, Debian, and
whatnot)... Weirdly enough, neither "thirdpartymirrors" nor
mirrorselect nor https://www.gentoo.org/downloads/mirrors/#DE list the
biggest mirror for gentoo-portage and -distfiles in .de, probably .eu ;)

*adding that one to my mirror-list*

HTH,
-dnh

-- 
Ceci n'est pas une .signature.


  reply	other threads:[~2018-03-28  0:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 18:50 [gentoo-user] What is the meaning of "mirror" URI scheme in ebuilds? Ian Zimmerman
2018-03-27 20:00 ` David Haller
2018-03-27 22:23   ` [gentoo-user] " Ian Zimmerman
2018-03-28  0:36     ` David Haller [this message]
2018-03-27 23:34 ` [gentoo-user] " Michael Orlitzky

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=20180328003657.4hklfioudleyc2cn@grusum.endjinn.de \
    --to=gentoo@dhaller.de \
    --cc=gentoo-user@lists.gentoo.org \
    /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