Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685708 - sys-apps/portage:: emirrordist ignores USE-conditional RESTRICTs
Summary: sys-apps/portage:: emirrordist ignores USE-conditional RESTRICTs
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
Depends on:
Reported: 2019-05-12 10:40 UTC by Sergei Trofimovich (RETIRED)
Modified: 2019-05-17 23:18 UTC (History)
0 users

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


Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2019-05-12 10:40:41 UTC
Noticed on two ebuilds when ran full emirrordist:

$ emirrordist --verbose --mirror --tries 1 --repo gentoo --distfiles $(portageq envvar DISTDIR)

[INFO] failure: games-action/descent1-data-1.4a setup_descent_1.4a_(16596).exe  no fetchable uris
[INFO] failure: games-action/descent2-data-1.2  setup_descent_2_1.1_(16596).exe no fetchable uris

AFAIU normally these would be fixed by RESTRICT="fetch mirror".

Ebuilds have the following:

$ cat descent1-data-1.4a.ebuild
  SRC_URI="cdinstall? ( )
        !cdinstall? ( ${MY_EXE} )"
  RESTRICT="bindist !cdinstall? ( fetch )"

$ cat descent2-data-1.2.ebuild

  SRC_URI="cdinstall? ( ${MY_PATCH} )
          !cdinstall? ( ${MY_EXE} )"
  RESTRICT="bindist !cdinstall? ( fetch )"

Adding "mirror" into RESTRICT under USE-condition does not help.

Is it an ebuild bug or emirrordist bug?
Comment 1 Zac Medico gentoo-dev 2019-05-13 03:27:50 UTC
The SRC_URI evaluation is oversimplified, it uses use_reduce with matchall=True like this:

> >>> use_reduce('cdinstall? ( ) !cdinstall? ( setup_descent_1.4a_(16596).exe )', uselist=None, matchall=True, eapi='6')
> ['', 'setup_descent_1.4a_(16596).exe']

We make it loop through all combinations of states for the USE flags found in RESTRICT, and evaluate SRC_URI only for those combinations where fetch is not restricted.
Comment 2 Zac Medico gentoo-dev 2019-05-17 23:18:25 UTC
The number of USE combinations could be prohibitively large in some cases (see bug 374397 for example), so in those cases we'll fallback to the matchall behavior.