From eedeff78fe473de3e9741154d4df9b91c85f2363 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 30 May 2010 08:15:39 +0200 Subject: [PATCH] [entropy.spm] PortagePlugin._portage_doebuild: cleanup unneeded license settings tweaks (thanks to zmedico) --- .../interfaces/portage_plugin/__init__.py | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/libraries/entropy/spm/plugins/interfaces/portage_plugin/__init__.py b/libraries/entropy/spm/plugins/interfaces/portage_plugin/__init__.py index 617cc9322..caa0fa366 100644 --- a/libraries/entropy/spm/plugins/interfaces/portage_plugin/__init__.py +++ b/libraries/entropy/spm/plugins/interfaces/portage_plugin/__init__.py @@ -1730,23 +1730,10 @@ class PortagePlugin(SpmPlugin): mysettings['EBUILD_PHASE'] = mydo mysettings['EMERGE_FROM'] = "binary" - # crappy, broken, ebuilds, put accept_license eutils call - # in pkg_setup, when environment variables are not setup yet - # WARNING WARNING WARNING: - # if some other hook fails for other reasons, it's because - # it may miss env variable here. - mysettings['LICENSE'] = str(' '.join(licenses)) - old_accept_license = os.environ.get('ACCEPT_LICENSE', "") - os.environ['ACCEPT_LICENSE'] = mysettings['LICENSE'] - if hasattr(mysettings, '_accept_license'): - old_settings_accept_license = mysettings._accept_license[:] - if mysettings['LICENSE'] not in mysettings._accept_license: - mysettings._accept_license += (mysettings['LICENSE'],) - - if licenses: - # we already do this early - mysettings["ACCEPT_LICENSE"] = mysettings['LICENSE'] - mysettings.backup_changes("ACCEPT_LICENSE") + # we already do this early + mysettings["ACCEPT_LICENSE"] = str(' '.join(licenses)) + mysettings.backup_changes("ACCEPT_LICENSE") + mysettings.regenerate() mysettings['EAPI'] = "0" if 'EAPI' in metadata: @@ -1859,10 +1846,6 @@ class PortagePlugin(SpmPlugin): # for security ! mysettings["PORTDIR"] = old_portdir mysettings.backup_changes("PORTDIR") - # set ACCEPT_LICENSE back - os.environ['ACCEPT_LICENSE'] = old_accept_license - if hasattr(mysettings, '_accept_license'): - mysettings._accept_license = old_settings_accept_license del mydbapi del metadata