commit:     a6ba2a33ca28b801661e6d783bb6662f16d132cc
Author:     Louis Chauvet <louis.chauvet <AT> bootlin <DOT> com>
AuthorDate: Wed Dec 17 07:10:13 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 18 01:34:02 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6ba2a33

lib/portage/package/ebuild/_config/LicenseManager.py: Read per-profile 
package.license

Currently the only way to unmask license in profile is to use the LICENSE
variable in make.defaults. This may be acceptable for "unique" licenses
(linux-fw-redistributable, only used by one package), but not practical for
"generic" licenses.

Read profile-specific package.license in LicenseManager so per-profile
per-package license can be configured.

Bug: https://bugs.gentoo.org/686888
Suggested-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Louis Chauvet <louis.chauvet <AT> bootlin.com>
Reviewed-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/package/ebuild/_config/LicenseManager.py | 2 ++
 man/portage.5                                        | 1 +
 2 files changed, 3 insertions(+)

diff --git a/lib/portage/package/ebuild/_config/LicenseManager.py 
b/lib/portage/package/ebuild/_config/LicenseManager.py
index c59fff6ea4..f515740071 100644
--- a/lib/portage/package/ebuild/_config/LicenseManager.py
+++ b/lib/portage/package/ebuild/_config/LicenseManager.py
@@ -28,6 +28,8 @@ class LicenseManager:
         self._read_license_groups(license_group_locations)
 
         if user_config:
+            for profile in locations_manager.profiles:
+                self._read_user_config(profile)
             self._read_user_config(locations_manager.abs_user_config)
 
     def _read_user_config(self, abs_user_config):

diff --git a/man/portage.5 b/man/portage.5
index d7b2063e0f..787fc18e1a 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -26,6 +26,7 @@ packages.build
 package.accept_keywords
 package.bashrc
 package.keywords
+package.license
 package.mask
 package.provided
 package.unmask

Reply via email to