summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/package/ebuild/_config/LicenseManager.py33
-rw-r--r--pym/portage/package/ebuild/config.py2
2 files changed, 20 insertions, 15 deletions
diff --git a/pym/portage/package/ebuild/_config/LicenseManager.py b/pym/portage/package/ebuild/_config/LicenseManager.py
index 1c74d9cdd..6350a3343 100644
--- a/pym/portage/package/ebuild/_config/LicenseManager.py
+++ b/pym/portage/package/ebuild/_config/LicenseManager.py
@@ -5,7 +5,7 @@ __all__ = (
'LicenseManager',
)
-import copy
+from copy import deepcopy
from portage import os
from portage.dep import ExtendedAtomDict, use_reduce
@@ -19,19 +19,24 @@ from portage.package.ebuild._config.helper import ordered_by_atom_specificity
class LicenseManager(object):
- def __init__(self, clone=None):
- if clone:
- self._accept_license_str = copy.deepcopy(clone._accept_license_str)
- self._accept_license = copy.deepcopy(clone._accept_license)
- self._plicensedict = copy.deepcopy(clone._plicensedict)
- self._license_groups = copy.deepcopy(clone._license_groups)
- self._undef_lic_groups = copy.deepcopy(clone._undef_lic_groups)
- else:
- self._accept_license_str = None
- self._accept_license = None
- self._license_groups = {}
- self._plicensedict = ExtendedAtomDict(dict)
- self._undef_lic_groups = set()
+ def __init__(self):
+ self._accept_license_str = None
+ self._accept_license = None
+ self._license_groups = {}
+ self._plicensedict = ExtendedAtomDict(dict)
+ self._undef_lic_groups = set()
+
+ def __deepcopy__(self, memo=None):
+ if memo is None:
+ memo = {}
+ result = self.__class__()
+ memo[id(self)] = result
+ result._accept_license_str = deepcopy(self._accept_license_str, memo)
+ result._accept_license = deepcopy(self._accept_license, memo)
+ result._plicensedict = deepcopy(self._plicensedict, memo)
+ result._license_groups = deepcopy(self._license_groups, memo)
+ result._undef_lic_groups = deepcopy(self._undef_lic_groups, memo)
+ return result
def read_config_files(self, abs_user_config):
licdict = grabdict_package(os.path.join(
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index a031314bf..8bea4af98 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -458,7 +458,7 @@ class config(object):
self.features._features = copy.deepcopy(clone.features._features)
self._features_overrides = copy.deepcopy(clone._features_overrides)
- self._license_manager = LicenseManager(clone._license_manager)
+ self._license_manager = copy.deepcopy(clone._license_manager)
self._accept_properties = copy.deepcopy(clone._accept_properties)
self._ppropertiesdict = copy.deepcopy(clone._ppropertiesdict)
self._penvdict = copy.deepcopy(clone._penvdict)