'LicenseManager',
)
-import copy
+from copy import deepcopy
from portage import os
from portage.dep import ExtendedAtomDict, use_reduce
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(
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)