Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 197594 - portage and lmirror FEATURE
Summary: portage and lmirror FEATURE
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 198097
  Show dependency tree
 
Reported: 2007-10-31 06:07 UTC by Alon Bar-Lev (RETIRED)
Modified: 2007-11-14 17:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
make FEATURES="mirror" behave just like make FEATURES="mirror lmirror" (mirror_all.patch,763 bytes, text/plain)
2007-10-31 19:49 UTC, Zac Medico
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alon Bar-Lev (RETIRED) gentoo-dev 2007-10-31 06:07:07 UTC
Hello,

I have an offline environment.
I installed a gentoo mirror in this environment and then had issues with all RESTRICT="mirror" ebuilds.

Looking at portage code, I could see portage.py::fetch() that someone already thought of this situation.

                if ("mirror" in features) and ("lmirror" not in features):
                        # lmirror should allow you to bypass mirror restrictions.
                        # XXX: This is not a good thing, and is temporary at best.

What I request is to make the lmirror permanent and document the "mirror" and "lmirror" in make.conf.example so people may know they are available for their use.

Thanks!
Comment 1 Zac Medico gentoo-dev 2007-10-31 17:08:12 UTC
I'd like to remove the need for lmirror since FEATURES=mirror doesn't seem very practical for maintaining a "public" mirror anyway. RESTRICT=mirror is meant as a directive for Gentoo mirrors and they don't use emerge to fetch files. They use rsync to fetch files from the master mirror, and the master mirror uses a separate mirror-dist program that respects RESTRICT=mirror and does not rely on FEATURES=mirror.
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2007-10-31 18:57:43 UTC
Oh... I cannot say I can follow you... :)

All I want is this:
I have a network that is not connected to the internet.
I have one server who contains all distfiles.
I need that this server will be used for all SRC_URI fetch operations.

As far as I understand portage fetches SRC_URI directly when RESTRICT=mirror is used. Anyway, this is what I see.

If you modify the behavior so that the mirror will always be attempted, this is fine, and you can ignore me... :)

Thanks!
Comment 3 Zac Medico gentoo-dev 2007-10-31 19:49:36 UTC
Created attachment 134832 [details]
make FEATURES="mirror" behave just like make FEATURES="mirror lmirror"

> If you modify the behavior so that the mirror will always be attempted, this is
> fine, and you can ignore me... :)

Right. RESTRICT=mirror only needs to be respected by real "public" Gentoo mirrors, and they don't use emerge to fetch anyway.  Therefore, I propose that we make emerge disregard RESTRICT=mirror.
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2007-10-31 20:19:21 UTC
Great!
Thanks for quick response!
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2007-11-01 00:12:48 UTC
(In reply to comment #3)
> Right. RESTRICT=mirror only needs to be respected by real "public" Gentoo
> mirrors, and they don't use emerge to fetch anyway.  Therefore, I propose that
> we make emerge disregard RESTRICT=mirror.

Did you double check that with infra that we (=Gentoo) don't rely on FEATURES=mirror in *any* way? Otherwise this could cause some legal trouble ...
Comment 6 Zac Medico gentoo-dev 2007-11-01 01:49:29 UTC
After pondering it some more, I think we should go the safe route and just document the existing behavior in case somebody relies on it.
Comment 7 Zac Medico gentoo-dev 2007-11-03 01:25:29 UTC
I've documented FEATURES=lmirror in make.conf.5 and it's released in 2.1.3.17.
Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-13 10:13:12 UTC
I think there is another minor modification, the "pass" should not be executed if lmirror feature is used.

portage.py::fetch()
        if "nomirror" in restrict or \
           "mirror" in restrict:
                # We don't add any mirrors.
                pass
        else:
                if try_mirrors:
                        mymirrors += [x.rstrip("/") for x in mysettings["GENTOO_MIRRORS"].split() if x]


Please also document the lmirror in make.conf.example.

Thanks!
Comment 9 Zac Medico gentoo-dev 2007-11-13 23:57:10 UTC
(In reply to comment #8)
> I think there is another minor modification, the "pass" should not be executed
> if lmirror feature is used.

Changing that doesn't make sense to me. RESTRICT=mirror is normally a pretty good indication that the files won't be on the mirrors, so trying them would be useless.

Maybe you'd be interested in the special "local" mirror type that's documented in "mirrors" section of `man portage`.

> Please also document the lmirror in make.conf.example.

I don't think this feature is really appropriate for inclusion in make.conf.example since we only have the most commonly used features there. We don't really want it to be an exhaustive list like `man make.conf` has.
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-14 06:06:12 UTC
I thought the lmirror feature was introduce so I won't have to modify /usr/portage/X. As far as I know if I update /usr/portage/profiles/thirdpartymirrors then resync, my updates are lost. And if I move this to /usr/local/portage and someone at gentoo update this file, I won't get this update, solving this via /etc/make.conf is a good solution.

Thanks!
Comment 11 Zac Medico gentoo-dev 2007-11-14 07:57:50 UTC
The "local" mirrors thing is done via /etc/portage/mirrors. Here's the relevant section from portage.5:

mirrors
    Whenever portage encounters a mirror:// style URL it will look up the actual hosts here. If the mirror set is not found here, it will check the global mirrors file at /usr/portage/profiles/thirdpartymirrors. You may also set a special mirror type called "local". This list of mirrors will be checked before GENTOO_MIRRORS and will be used even if the package has RESTRICT="mirror" or RESTRICT="fetch".

    Format:

    - comments begin with #
    - mirror type followed by a list of hosts

    Example:

    # local private mirrors used only by my company
    local ftp://192.168.0.3/mirrors/gentoo http://192.168.0.4/distfiles
Comment 12 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-14 17:43:41 UTC
OK.
Sorry.
I will test this.
I thought that this is why lmirror FEATURE exists.