Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 577418 Details for
Bug 686344
sys-apps/portage: generate --autounmask changes for installed packages
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
python script that generates package.license settings for installed packages
pl-generator.py (text/x-python), 1.77 KB, created by
Zac Medico
on 2019-05-20 18:35:57 UTC
(
hide
)
Description:
python script that generates package.license settings for installed packages
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2019-05-20 18:35:57 UTC
Size:
1.77 KB
patch
obsolete
>#!/usr/bin/env python > >from __future__ import unicode_literals >from __future__ import print_function > >import sys > >from portage.package.ebuild._config.LocationsManager import LocationsManager >from portage.package.ebuild._config.LicenseManager import LicenseManager >from portage.repository.config import load_repository_config >import portage.proxy.lazyimport >import portage.proxy as proxy >proxy.lazyimport.lazyimport(globals(), > '_emerge.RootConfig:RootConfig', > 'portage.dbapi', > 'portage.package.ebuild.config:autouse,best_from_dict,' + \ > 'check_config_instance,config', >) > >def main(): > if (len(sys.argv) < 2): > #print("Assuming EROOT = '/' ...") > eroot = '/' > else: > eroot = sys.argv[1] > > settings = config(config_root=None, target_root=eroot) > > locations_manager = LocationsManager(config_root=None, > config_profile_path=None, > eprefix=None, > local_config=True, > target_root=eroot) > > locations_manager.set_port_dirs(settings.get("PORTDIR"), > settings.get("PORTDIR_OVERLAY")) > > abs_user_config = locations_manager.abs_user_config > > license_manager = LicenseManager(locations_manager.profile_locations, > abs_user_config, > user_config=True) > > license_manager.set_accept_license_str("-* @FREE") > > vardb = portage.db[eroot]["vartree"].dbapi > > for cpv in vardb.cpv_all(): > db_keys = list(vardb._aux_cache_keys) > metadata = dict(zip(db_keys, vardb.aux_get(cpv, db_keys, myrepo=None))) > > if "?" in metadata["LICENSE"]: > settings.setcpv(cpv, mydb=metadata) > metadata["USE"] = settings["PORTAGE_USE"] > else: > metadata["USE"] = "" > > missing_license = license_manager.getMissingLicenses(cpv, > metadata["USE"], metadata["LICENSE"], metadata["SLOT"], metadata.get('repository')) > if missing_license: > print('>={} {}'.format(cpv, ''.join(missing_license))) > >if __name__ == '__main__': > main()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 686344
:
577418