Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677800 - Migrate the ACCEPT_LICENSE default from portage to the base profile
Summary: Migrate the ACCEPT_LICENSE default from portage to the base profile
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, PATCH
Depends on:
Blocks: 671498 676248
  Show dependency tree
 
Reported: 2019-02-12 14:25 UTC by Ulrich Müller
Modified: 2019-05-24 18:39 UTC (History)
1 user (show)

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


Attachments
Proposed patch for Portage (0001-Don-t-define-a-default-for-ACCEPT_LICENSE.patch,4.23 KB, patch)
2019-02-12 14:26 UTC, Ulrich Müller
Details | Diff
Updated patch for Portage (0001-Don-t-define-a-default-for-ACCEPT_LICENSE.patch,5.14 KB, patch)
2019-02-12 21:54 UTC, Ulrich Müller
Details | Diff
Patch (portage.patch,1.93 KB, patch)
2019-02-13 01:36 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff
Updated Arfrever's patch (0001-ResolverPlayground-Set-ACCEPT_LICENSE-for-test-suite.patch,2.21 KB, patch)
2019-02-13 06:28 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2019-02-12 14:25:01 UTC
In its 2019-02-10 meeting, the Gentoo Council has decided that the
default for ACCEPT_LICENSE should be changed to @FREE.

As discussed in #gentoo-council after the meeting, we think that the default should be moved to make.defaults in the base profile, for the following reasons:
- The setting depends on the @FREE license group, which itself is not defined in Portage, but in profiles/license_groups.
- Setting the default in profiles will allow to perform the switchover at a precise time, independent of Portage release and stabilisation schedule.
- Profiles are a better location to define the default distro policy.
- GLEP 23 says so.

The plan would be to first add the current default, namely ACCEPT_LICENSE="* -@EULA" to profiles/base/make.defaults and remove the default from Portage (patch will follow).

At a later time (at least after waiting for the new Portage version to become stable), the default in profiles can then be flipped from "* -@EULA" to "-* @FREE".
Comment 1 Ulrich Müller gentoo-dev 2019-02-12 14:26:02 UTC
Created attachment 564928 [details, diff]
Proposed patch for Portage
Comment 2 Zac Medico gentoo-dev 2019-02-12 18:52:15 UTC
(In reply to Ulrich Müller from comment #1)
> Created attachment 564928 [details, diff] [details, diff]
> Proposed patch for Portage

Looks good, except we need to add a fallback in order for the unit tests to pass:

> diff --git a/lib/portage/package/ebuild/config.py b/lib/portage/package/ebuild/config.py
> index 8de23e2e5..2981f7e31 100644
> --- a/lib/portage/package/ebuild/config.py
> +++ b/lib/portage/package/ebuild/config.py
> @@ -1,4 +1,4 @@
> -# Copyright 2010-2018 Gentoo Foundation
> +# Copyright 2010-2019 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>  
>  from __future__ import unicode_literals
> @@ -2278,7 +2278,7 @@ class config(object):
>                         for curdb in mydbs:
>                                 mysplit.extend(curdb.get('ACCEPT_LICENSE', '').split())
>                         mysplit = prune_incremental(mysplit)
> -                       accept_license_str = ' '.join(mysplit)
> +                       accept_license_str = ' '.join(mysplit) or '* -@EULA'
>                         self.configlist[-1]['ACCEPT_LICENSE'] = accept_license_str
>                         self._license_manager.set_accept_license_str(accept_license_str)
>                 else:
Comment 3 Ulrich Müller gentoo-dev 2019-02-12 21:54:13 UTC
Created attachment 565022 [details, diff]
Updated patch for Portage

(In reply to Zac Medico from comment #2)
> Looks good, except we need to add a fallback in order for the unit tests to
> pass:

Patch updated.
Comment 4 Zac Medico gentoo-dev 2019-02-12 22:29:35 UTC
(In reply to Ulrich Müller from comment #3)
> Created attachment 565022 [details, diff] [details, diff]
> Updated patch for Portage
> 
> (In reply to Zac Medico from comment #2)
> > Looks good, except we need to add a fallback in order for the unit tests to
> > pass:
> 
> Patch updated.

Looks good, please go ahead an merge when you're ready.
Comment 5 Larry the Git Cow gentoo-dev 2019-02-12 22:36:26 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=94669648977c1ea851b0911a1ec99c64b4c18273

commit 94669648977c1ea851b0911a1ec99c64b4c18273
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2019-02-12 14:15:32 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-02-12 22:34:07 +0000

    Don't define a default for ACCEPT_LICENSE
    
    In its 2019-02-10 meeting, the Gentoo Council has decided that the
    default for ACCEPT_LICENSE should be changed to @FREE. We take that
    opportunity to move the default to make.defaults in the base profile,
    for the following reasons:
     - The setting depends on the @FREE license group, which itself is not
       defined in Portage, but in profiles/license_groups.
     - Setting the default in profiles will allow to perform the switchover
       at a precise time, independent of Portage release and stabilisation
       schedule.
     - Profiles are a better location to define the default distro policy.
     - GLEP 23 says so.
    
    Bug: https://bugs.gentoo.org/677800
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 cnf/make.conf.example                                  | 8 ++++----
 cnf/make.globals                                       | 3 +--
 lib/portage/package/ebuild/_config/special_env_vars.py | 3 +--
 lib/portage/package/ebuild/config.py                   | 4 ++--
 man/make.conf.5                                        | 6 +++---
 5 files changed, 11 insertions(+), 13 deletions(-)
Comment 6 Larry the Git Cow gentoo-dev 2019-02-12 22:36:51 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d058d2cddc048782667c2ef995e2bc408ba783b2

commit d058d2cddc048782667c2ef995e2bc408ba783b2
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2019-02-12 22:01:10 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-02-12 22:36:00 +0000

    profiles: Define a default for ACCEPT_LICENSE.
    
    In its 2019-02-10 meeting, the Gentoo Council has decided that the
    default for ACCEPT_LICENSE should be changed to @FREE. We take that
    opportunity to move the default to make.defaults in the base profile,
    for the following reasons:
     - The setting depends on the @FREE license group, which itself is not
       defined in Portage, but in profiles/license_groups.
     - Setting the default in profiles will allow to perform the switchover
       at a precise time, independent of Portage release and stabilisation
       schedule.
     - Profiles are a better location to define the default distro policy.
     - GLEP 23 says so.
    
    Bug: https://bugs.gentoo.org/677800
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 profiles/base/make.defaults | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 7 Arfrever Frehtes Taifersar Arahesis 2019-02-13 01:36:50 UTC
Created attachment 565026 [details, diff]
Patch

(In reply to Zac Medico from comment #2)
> Looks good, except we need to add a fallback in order for
> the unit tests to pass

I think that value needed for test suite should be set in test suite directly.
Comment 8 Zac Medico gentoo-dev 2019-02-13 01:51:35 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #7)
> Created attachment 565026 [details, diff] [details, diff]
> Patch
> 
> (In reply to Zac Medico from comment #2)
> > Looks good, except we need to add a fallback in order for
> > the unit tests to pass
> 
> I think that value needed for test suite should be set in test suite
> directly.

I want a fallback for other cases like bug 644990.
Comment 9 Ulrich Müller gentoo-dev 2019-02-13 06:05:55 UTC
(In reply to Zac Medico from comment #8)
> (In reply to Arfrever Frehtes Taifersar Arahesis from comment #7)
> > Created attachment 565026 [details, diff] [details, diff] [details, diff]
> > Patch
> > 
> > (In reply to Zac Medico from comment #2)
> > > Looks good, except we need to add a fallback in order for
> > > the unit tests to pass
> > 
> > I think that value needed for test suite should be set in test suite
> > directly.
> 
> I want a fallback for other cases like bug 644990.

Maybe that fallback could agree with the upcoming default though, namely "@FREE"?
Comment 10 Zac Medico gentoo-dev 2019-02-13 06:15:02 UTC
(In reply to Ulrich Müller from comment #9)
> (In reply to Zac Medico from comment #8)
> > (In reply to Arfrever Frehtes Taifersar Arahesis from comment #7)
> > > Created attachment 565026 [details, diff] [details, diff] [details, diff] [details, diff]
> > > Patch
> > > 
> > > (In reply to Zac Medico from comment #2)
> > > > Looks good, except we need to add a fallback in order for
> > > > the unit tests to pass
> > > 
> > > I think that value needed for test suite should be set in test suite
> > > directly.
> > 
> > I want a fallback for other cases like bug 644990.
> 
> Maybe that fallback could agree with the upcoming default though, namely
> "@FREE"?

Sure, that will work for me. I just want some kind of sane default in the absence of an explicit setting.
Comment 11 Ulrich Müller gentoo-dev 2019-02-13 06:28:56 UTC
Created attachment 565028 [details, diff]
Updated Arfrever's patch
Comment 12 Arfrever Frehtes Taifersar Arahesis 2019-02-13 06:37:38 UTC
(In reply to Zac Medico from comment #8)
> (In reply to Arfrever Frehtes Taifersar Arahesis from comment #7)
> > (In reply to Zac Medico from comment #2)
> > > Looks good, except we need to add a fallback in order for
> > > the unit tests to pass
> > 
> > I think that value needed for test suite should be set in test suite
> > directly.
> 
> I want a fallback for other cases like bug 644990.

Maybe a more obvious place for such fallback value would be /usr/share/portage/config/profile_defaults.conf (or different name) instead of being buried somewhere in config.py? :)
Comment 13 Zac Medico gentoo-dev 2019-02-15 16:21:56 UTC
(In reply to Ulrich Müller from comment #11)
> Created attachment 565028 [details, diff] [details, diff]
> Updated Arfrever's patch

Actually, I don't like @FREE fallback since it's useless unless @FREE is actually defined and that would required a valid gentoo/profiles directory.
Comment 14 Ulrich Müller gentoo-dev 2019-02-15 19:44:57 UTC
(In reply to Zac Medico from comment #13)
> (In reply to Ulrich Müller from comment #11)
> > Created attachment 565028 [details, diff] [details, diff] [details, diff]
> > Updated Arfrever's patch
> 
> Actually, I don't like @FREE fallback since it's useless unless @FREE is
> actually defined and that would required a valid gentoo/profiles directory.

The same is true for "* -@EULA".

Would that at least error out if it doesn't find license_groups, or would it fall back to "*"? Because the latter should really be avoided.
Comment 15 Zac Medico gentoo-dev 2019-02-15 19:50:51 UTC
(In reply to Ulrich Müller from comment #14)
> (In reply to Zac Medico from comment #13)
> > (In reply to Ulrich Müller from comment #11)
> > > Created attachment 565028 [details, diff] [details, diff] [details, diff] [details, diff]
> > > Updated Arfrever's patch
> > 
> > Actually, I don't like @FREE fallback since it's useless unless @FREE is
> > actually defined and that would required a valid gentoo/profiles directory.
> 
> The same is true for "* -@EULA".
> 
> Would that at least error out if it doesn't find license_groups, or would it
> fall back to "*"? Because the latter should really be avoided.

It would fall back to "*" because @EULA would is treated as an empty set in this case.
Comment 16 Larry the Git Cow gentoo-dev 2019-02-18 00:54:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=efd6e6de1e19117224e20690cf11c16105ce817b

commit efd6e6de1e19117224e20690cf11c16105ce817b
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-02-18 00:48:55 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-02-18 00:49:53 +0000

    sys-apps/portage: version bump to 2.3.61
    
     #677776 gnome2_icon_cache_update -> xdg_icon_cache_update
     #677800 Don't define a default for ACCEPT_LICENSE
     #678218 locks: handle sshfs hardlink inode numbers
     FL-6227 cpuinfo: use better available CPU calculation
    
    Bug: https://bugs.gentoo.org/671498
    Bug: https://bugs.gentoo.org/677776
    Bug: https://bugs.gentoo.org/677800
    Bug: https://bugs.gentoo.org/678218
    Package-Manager: Portage-2.3.61, Repoman-2.3.12
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.61.ebuild | 271 +++++++++++++++++++++++++++++++++
 2 files changed, 272 insertions(+)
Comment 17 Zac Medico gentoo-dev 2019-04-10 04:30:33 UTC
Fixed in portage-2.3.62.
Comment 18 Ulrich Müller gentoo-dev 2019-05-20 15:37:38 UTC
(In reply to Zac Medico from comment #2)
> > -                       accept_license_str = ' '.join(mysplit)
> > +                       accept_license_str = ' '.join(mysplit) or '* -@EULA'

Actually, a consequence of that fallback is that the following command:
ACCEPT_LICENSE="-*" emerge -ep --autounmask-backtrack=y @world
does not work as intended (discovered by NeddySeagoon).

Instead of reporting the licenses of all installed packages, it will exclude almost everything and list only the ones in @EULA.

I think that the above is valid usage, so this should be fixed.
Comment 19 Ulrich Müller gentoo-dev 2019-05-20 15:47:36 UTC
(In reply to Ulrich Müller from comment #18)
> I think that the above is valid usage, so this should be fixed.

Could we apply Arfrever's patch from comment #7?
Comment 20 Zac Medico gentoo-dev 2019-05-20 18:27:29 UTC
(In reply to Ulrich Müller from comment #19)
> (In reply to Ulrich Müller from comment #18)
> > I think that the above is valid usage, so this should be fixed.
> 
> Could we apply Arfrever's patch from comment #7?

I have a different fix in mind. Reported as bug 686406.
Comment 21 Ulrich Müller gentoo-dev 2019-05-24 18:39:07 UTC
OK, closing again, if there's another bug for that issue.