From: Zac Medico Date: Tue, 27 Nov 2012 04:37:41 +0000 (-0800) Subject: Rename Package.metadata to _metadata. X-Git-Tag: v2.2.0_alpha143~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8fa262d62b885d5cd8251faa018695022311872a;p=portage.git Rename Package.metadata to _metadata. The raw metadata is considered a private low-level internal. This makes the Package class consistent with the _pkg_str class. --- diff --git a/bin/repoman b/bin/repoman index 7ecdc6d19..a38ffe121 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1753,7 +1753,7 @@ for x in effective_scanlist: fails[k].append("%s: %s" % (relative_path, msg)) continue - myaux = pkg.metadata + myaux = pkg._metadata eapi = myaux["EAPI"] inherited = pkg.inherited live_ebuild = live_eclasses.intersection(inherited) @@ -2174,7 +2174,7 @@ for x in effective_scanlist: if ismasked: if not have_pmasked: have_pmasked = bool(dep_settings._getMaskAtom( - pkg.cpv, pkg.metadata)) + pkg.cpv, pkg._metadata)) if options.ignore_masked: continue #we are testing deps for a masked package; give it some lee-way diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py index ce8806d91..8bb8f5fda 100644 --- a/pym/_emerge/BlockerDB.py +++ b/pym/_emerge/BlockerDB.py @@ -92,7 +92,7 @@ class BlockerDB(object): blocking_pkgs.update(blocker_parents.parent_nodes(atom)) # Check for blockers in the other direction. - depstr = " ".join(new_pkg.metadata[k] for k in dep_keys) + depstr = " ".join(new_pkg._metadata[k] for k in dep_keys) success, atoms = portage.dep_check(depstr, vardb, settings, myuse=new_pkg.use.enabled, trees=dep_check_trees, myroot=new_pkg.root) diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 784a3e298..2da09e7f3 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -260,8 +260,8 @@ class EbuildBuild(CompositeTask): # to be displayed for problematic packages even though they do # not set RESTRICT=fetch (bug #336499). - if 'fetch' not in self.pkg.metadata.restrict and \ - 'nofetch' not in self.pkg.metadata.defined_phases: + if 'fetch' not in self.pkg._metadata.restrict and \ + 'nofetch' not in self.pkg._metadata.defined_phases: self._unlock_builddir() self.wait() return diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index f73fe82f3..7950ffb81 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -3,6 +3,8 @@ import sys from itertools import chain +import warnings + import portage from portage import _encodings, _unicode_decode, _unicode_encode from portage.cache.mappings import slot_dict_class @@ -26,12 +28,12 @@ class Package(Task): __hash__ = Task.__hash__ __slots__ = ("built", "cpv", "depth", - "installed", "metadata", "onlydeps", "operation", + "installed", "onlydeps", "operation", "root_config", "type_name", "category", "counter", "cp", "cpv_split", "inherited", "iuse", "mtime", "pf", "root", "slot", "sub_slot", "slot_atom", "version") + \ - ("_invalid", "_raw_metadata", "_masks", "_use", + ("_invalid", "_masks", "_metadata", "_raw_metadata", "_use", "_validated_atoms", "_visible") metadata_keys = [ @@ -48,20 +50,21 @@ class Package(Task): UNKNOWN_REPO = _unknown_repo def __init__(self, **kwargs): + metadata = _PackageMetadataWrapperBase(kwargs.pop('metadata')) Task.__init__(self, **kwargs) # the SlotObject constructor assigns self.root_config from keyword args # and is an instance of a '_emerge.RootConfig.RootConfig class self.root = self.root_config.root - self._raw_metadata = _PackageMetadataWrapperBase(self.metadata) - self.metadata = _PackageMetadataWrapper(self, self._raw_metadata) + self._raw_metadata = metadata + self._metadata = _PackageMetadataWrapper(self, metadata) if not self.built: - self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '') + self._metadata['CHOST'] = self.root_config.settings.get('CHOST', '') eapi_attrs = _get_eapi_attrs(self.eapi) - self.cpv = _pkg_str(self.cpv, metadata=self.metadata, + self.cpv = _pkg_str(self.cpv, metadata=self._metadata, settings=self.root_config.settings) if hasattr(self.cpv, 'slot_invalid'): self._invalid_metadata('SLOT.invalid', - "SLOT: invalid value: '%s'" % self.metadata["SLOT"]) + "SLOT: invalid value: '%s'" % self._metadata["SLOT"]) self.cpv_split = self.cpv.cpv_split self.category, self.pf = portage.catsplit(self.cpv) self.cp = self.cpv.cp @@ -70,14 +73,14 @@ class Package(Task): self.sub_slot = self.cpv.sub_slot self.slot_atom = Atom("%s%s%s" % (self.cp, _slot_separator, self.slot)) # sync metadata with validated repo (may be UNKNOWN_REPO) - self.metadata['repository'] = self.cpv.repo + self._metadata['repository'] = self.cpv.repo if eapi_attrs.iuse_effective: implicit_match = self.root_config.settings._iuse_effective_match else: implicit_match = self.root_config.settings._iuse_implicit_match usealiases = self.root_config.settings._use_manager.getUseAliases(self) - self.iuse = self._iuse(self, self.metadata["IUSE"].split(), implicit_match, + self.iuse = self._iuse(self, self._metadata["IUSE"].split(), implicit_match, usealiases, self.eapi) if (self.iuse.enabled or self.iuse.disabled) and \ @@ -103,12 +106,13 @@ class Package(Task): @property def eapi(self): - return self.metadata["EAPI"] + return self._metadata["EAPI"] - # For consistency with _pkg_str @property - def _metadata(self): - return self.metadata + def metadata(self): + warnings.warn("_emerge.Package.Package.metadata is deprecated", + DeprecationWarning, stacklevel=3) + return self._metadata # These are calculated on-demand, so that they are calculated # after FakeVartree applies its metadata tweaks. @@ -202,7 +206,7 @@ class Package(Task): validated_atoms = [] for k in self._dep_keys: - v = self.metadata.get(k) + v = self._metadata.get(k) if not v: continue try: @@ -228,7 +232,7 @@ class Package(Task): validated_atoms if isinstance(atom, Atom))) k = 'PROVIDE' - v = self.metadata.get(k) + v = self._metadata.get(k) if v: try: use_reduce(v, eapi=dep_eapi, matchall=True, @@ -238,7 +242,7 @@ class Package(Task): _unicode_decode("%s: %s") % (k, e)) for k in self._use_conditional_misc_keys: - v = self.metadata.get(k) + v = self._metadata.get(k) if not v: continue try: @@ -248,7 +252,7 @@ class Package(Task): self._metadata_exception(k, e) k = 'REQUIRED_USE' - v = self.metadata.get(k) + v = self._metadata.get(k) if v and not self.built: if not _get_eapi_attrs(eapi).required_use: self._invalid_metadata('EAPI.incompatible', @@ -265,7 +269,7 @@ class Package(Task): _unicode_decode("%s: %s") % (k, e)) k = 'SRC_URI' - v = self.metadata.get(k) + v = self._metadata.get(k) if v: try: use_reduce(v, is_src_uri=True, eapi=eapi, matchall=True, @@ -287,8 +291,8 @@ class Package(Task): if self.invalid is not False: masks['invalid'] = self.invalid - if not settings._accept_chost(self.cpv, self.metadata): - masks['CHOST'] = self.metadata['CHOST'] + if not settings._accept_chost(self.cpv, self._metadata): + masks['CHOST'] = self._metadata['CHOST'] eapi = self.eapi if not portage.eapi_is_supported(eapi): @@ -297,26 +301,26 @@ class Package(Task): masks['EAPI.deprecated'] = eapi missing_keywords = settings._getMissingKeywords( - self.cpv, self.metadata) + self.cpv, self._metadata) if missing_keywords: masks['KEYWORDS'] = missing_keywords try: missing_properties = settings._getMissingProperties( - self.cpv, self.metadata) + self.cpv, self._metadata) if missing_properties: masks['PROPERTIES'] = missing_properties except InvalidDependString: # already recorded as 'invalid' pass - mask_atom = settings._getMaskAtom(self.cpv, self.metadata) + mask_atom = settings._getMaskAtom(self.cpv, self._metadata) if mask_atom is not None: masks['package.mask'] = mask_atom try: missing_licenses = settings._getMissingLicenses( - self.cpv, self.metadata) + self.cpv, self._metadata) if missing_licenses: masks['LICENSE'] = missing_licenses except InvalidDependString: @@ -355,7 +359,7 @@ class Package(Task): """returns None, 'missing', or 'unstable'.""" missing = self.root_config.settings._getRawMissingKeywords( - self.cpv, self.metadata) + self.cpv, self._metadata) if not missing: return None @@ -376,7 +380,7 @@ class Package(Task): """returns a bool if the cpv is in the list of expanded pmaskdict[cp] available ebuilds""" pmask = self.root_config.settings._getRawMaskAtom( - self.cpv, self.metadata) + self.cpv, self._metadata) return pmask is not None def _metadata_exception(self, k, e): @@ -529,7 +533,7 @@ class Package(Task): @property def repo(self): - return self.metadata['repository'] + return self._metadata['repository'] @property def repo_priority(self): @@ -541,7 +545,7 @@ class Package(Task): @property def use(self): if self._use is None: - self.metadata._init_use() + self._metadata._init_use() return self._use def _get_pkgsettings(self): diff --git a/pym/_emerge/PackageVirtualDbapi.py b/pym/_emerge/PackageVirtualDbapi.py index 0f7be44b1..56a5576e3 100644 --- a/pym/_emerge/PackageVirtualDbapi.py +++ b/pym/_emerge/PackageVirtualDbapi.py @@ -140,10 +140,10 @@ class PackageVirtualDbapi(dbapi): self._clear_cache() def aux_get(self, cpv, wants, myrepo=None): - metadata = self._cpv_map[cpv].metadata + metadata = self._cpv_map[cpv]._metadata return [metadata.get(x, "") for x in wants] def aux_update(self, cpv, values): - self._cpv_map[cpv].metadata.update(values) + self._cpv_map[cpv]._metadata.update(values) self._clear_cache() diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index ff2938020..72f1943e8 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -409,7 +409,7 @@ class Scheduler(PollScheduler): if not (isinstance(task, Package) and \ task.operation == "merge"): continue - if 'interactive' in task.metadata.properties: + if 'interactive' in task._metadata.properties: interactive_tasks.append(task) return interactive_tasks @@ -786,7 +786,7 @@ class Scheduler(PollScheduler): if x.eapi in ("0", "1", "2", "3"): continue - if "pretend" not in x.metadata.defined_phases: + if "pretend" not in x._metadata.defined_phases: continue out_str =">>> Running pre-merge checks for " + colorize("INFORM", x.cpv) + "\n" diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index cd52ddb1b..b64614e1d 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -706,7 +706,7 @@ def calc_depclean(settings, trees, ldpath_mtimes, continue except portage.exception.InvalidDependString as e: show_invalid_depstring_notice(pkg, - pkg.metadata["PROVIDE"], str(e)) + pkg._metadata["PROVIDE"], _unicode(e)) del e protected_set.add("=" + pkg.cpv) continue @@ -760,7 +760,7 @@ def calc_depclean(settings, trees, ldpath_mtimes, continue except portage.exception.InvalidDependString as e: show_invalid_depstring_notice(pkg, - pkg.metadata["PROVIDE"], str(e)) + pkg._metadata["PROVIDE"], _unicode(e)) del e protected_set.add("=" + pkg.cpv) continue @@ -778,7 +778,7 @@ def calc_depclean(settings, trees, ldpath_mtimes, required_sets['__excluded__'].add("=" + pkg.cpv) except portage.exception.InvalidDependString as e: show_invalid_depstring_notice(pkg, - pkg.metadata["PROVIDE"], str(e)) + pkg._metadata["PROVIDE"], _unicode(e)) del e required_sets['__excluded__'].add("=" + pkg.cpv) @@ -1168,7 +1168,7 @@ def calc_depclean(settings, trees, ldpath_mtimes, for node in clean_set: graph.add(node, None) for dep_type in Package._dep_keys: - depstr = node.metadata[dep_type] + depstr = node._metadata[dep_type] if not depstr: continue priority = priority_map[dep_type] diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index df4914316..702f7fe04 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -269,7 +269,7 @@ class _rebuild_config(object): return True elif (parent.installed and root_slot not in self.reinstall_list): - inst_build_time = parent.metadata.get("BUILD_TIME") + inst_build_time = parent._metadata.get("BUILD_TIME") try: bin_build_time, = bindb.aux_get(parent.cpv, ["BUILD_TIME"]) @@ -593,8 +593,8 @@ class depgraph(object): if selected_pkg.installed and \ selected_pkg.cpv == pkg.cpv and \ - selected_pkg.metadata.get('BUILD_TIME') == \ - pkg.metadata.get('BUILD_TIME'): + selected_pkg._metadata.get('BUILD_TIME') == \ + pkg._metadata.get('BUILD_TIME'): # We don't care about ignored binaries when an # identical installed instance is selected to # fill the slot. @@ -1490,10 +1490,10 @@ class depgraph(object): # package selection, since we want to prompt the user # for USE adjustment rather than have REQUIRED_USE # affect package selection and || dep choices. - if not pkg.built and pkg.metadata.get("REQUIRED_USE") and \ + if not pkg.built and pkg._metadata.get("REQUIRED_USE") and \ eapi_has_required_use(pkg.eapi): required_use_is_sat = check_required_use( - pkg.metadata["REQUIRED_USE"], + pkg._metadata["REQUIRED_USE"], self._pkg_use_enabled(pkg), pkg.iuse.is_valid_flag, eapi=pkg.eapi) @@ -1577,11 +1577,11 @@ class depgraph(object): # doesn't already. Any pre-existing providers will be preferred # over this one. try: - pkgsettings.setinst(pkg.cpv, pkg.metadata) + pkgsettings.setinst(pkg.cpv, pkg._metadata) # For consistency, also update the global virtuals. settings = self._frozen_config.roots[pkg.root].settings settings.unlock() - settings.setinst(pkg.cpv, pkg.metadata) + settings.setinst(pkg.cpv, pkg._metadata) settings.lock() except portage.exception.InvalidDependString: if not pkg.installed: @@ -1682,7 +1682,7 @@ class depgraph(object): def _add_pkg_deps(self, pkg, allow_unsatisfied=False): myroot = pkg.root - metadata = pkg.metadata + metadata = pkg._metadata removal_action = "remove" in self._dynamic_config.myparams eapi_attrs = _get_eapi_attrs(pkg.eapi) @@ -2877,7 +2877,7 @@ class depgraph(object): blockers = {} blocker_dep_keys = Package._dep_keys for pkg in greedy_pkgs + [highest_pkg]: - dep_str = " ".join(pkg.metadata[k] for k in blocker_dep_keys) + dep_str = " ".join(pkg._metadata[k] for k in blocker_dep_keys) try: selected_atoms = self._select_atoms( pkg.root, dep_str, self._pkg_use_enabled(pkg), @@ -3066,7 +3066,7 @@ class depgraph(object): return try: rdepend = self._select_atoms_from_graph( - pkg.root, pkg.metadata.get("RDEPEND", ""), + pkg.root, pkg._metadata.get("RDEPEND", ""), myuse=self._pkg_use_enabled(pkg), parent=pkg, strict=False) except InvalidDependString as e: @@ -3094,7 +3094,7 @@ class depgraph(object): """ try: rdepend = self._select_atoms( - pkg.root, pkg.metadata.get("RDEPEND", ""), + pkg.root, pkg._metadata.get("RDEPEND", ""), myuse=self._pkg_use_enabled(pkg), parent=pkg, priority=self._priority(runtime=True)) except InvalidDependString as e: @@ -3139,7 +3139,7 @@ class depgraph(object): for dep_str in Package._dep_keys: try: affecting_use.update(extract_affecting_use( - node.metadata[dep_str], target_atom, + node._metadata[dep_str], target_atom, eapi=node.eapi)) except InvalidDependString: if not node.installed: @@ -3218,16 +3218,16 @@ class depgraph(object): # This edge comes from _parent_atoms and was not added to # the graph, and _parent_atoms does not contain priorities. for k in Package._dep_keys: - dep_strings.add(node.metadata[k]) + dep_strings.add(node._metadata[k]) else: for priority in priorities: if priority.buildtime: for k in Package._buildtime_keys: - dep_strings.add(node.metadata[k]) + dep_strings.add(node._metadata[k]) if priority.runtime: - dep_strings.add(node.metadata["RDEPEND"]) + dep_strings.add(node._metadata["RDEPEND"]) if priority.runtime_post: - dep_strings.add(node.metadata["PDEPEND"]) + dep_strings.add(node._metadata["PDEPEND"]) affecting_use = set() for dep_str in dep_strings: @@ -3376,9 +3376,9 @@ class depgraph(object): repo = metadata.get('repository') pkg = self._pkg(cpv, pkg_type, root_config, installed=installed, myrepo=repo) - # pkg.metadata contains calculated USE for ebuilds, + # pkg._metadata contains calculated USE for ebuilds, # required later for getMissingLicenses. - metadata = pkg.metadata + metadata = pkg._metadata if pkg.invalid: # Avoid doing any operations with packages that # have invalid metadata. It would be unsafe at @@ -3417,10 +3417,10 @@ class depgraph(object): raise if not mreasons and \ not pkg.built and \ - pkg.metadata.get("REQUIRED_USE") and \ + pkg._metadata.get("REQUIRED_USE") and \ eapi_has_required_use(pkg.eapi): if not check_required_use( - pkg.metadata["REQUIRED_USE"], + pkg._metadata["REQUIRED_USE"], self._pkg_use_enabled(pkg), pkg.iuse.is_valid_flag, eapi=pkg.eapi): @@ -3473,7 +3473,7 @@ class depgraph(object): continue missing_use_adjustable.add(pkg) - required_use = pkg.metadata.get("REQUIRED_USE") + required_use = pkg._metadata.get("REQUIRED_USE") required_use_warning = "" if required_use: old_use = self._pkg_use_enabled(pkg) @@ -3523,7 +3523,7 @@ class depgraph(object): if any(x in untouchable_flags for x in involved_flags): continue - required_use = myparent.metadata.get("REQUIRED_USE") + required_use = myparent._metadata.get("REQUIRED_USE") required_use_warning = "" if required_use: old_use = self._pkg_use_enabled(myparent) @@ -3625,7 +3625,7 @@ class depgraph(object): writemsg("\n The following REQUIRED_USE flag constraints " + \ "are unsatisfied:\n", noiselevel=-1) reduced_noise = check_required_use( - pkg.metadata["REQUIRED_USE"], + pkg._metadata["REQUIRED_USE"], self._pkg_use_enabled(pkg), pkg.iuse.is_valid_flag, eapi=pkg.eapi).tounicode() @@ -3633,7 +3633,7 @@ class depgraph(object): human_readable_required_use(reduced_noise), noiselevel=-1) normalized_required_use = \ - " ".join(pkg.metadata["REQUIRED_USE"].split()) + " ".join(pkg._metadata["REQUIRED_USE"].split()) if reduced_noise != normalized_required_use: writemsg("\n The above constraints " + \ "are a subset of the following complete expression:\n", @@ -3886,7 +3886,7 @@ class depgraph(object): return True def _equiv_binary_installed(self, pkg): - build_time = pkg.metadata.get('BUILD_TIME') + build_time = pkg._metadata.get('BUILD_TIME') if not build_time: return False @@ -3896,7 +3896,7 @@ class depgraph(object): except PackageNotFound: return False - return build_time == inst_pkg.metadata.get('BUILD_TIME') + return build_time == inst_pkg._metadata.get('BUILD_TIME') class _AutounmaskLevel(object): __slots__ = ("allow_use_changes", "allow_unstable_keywords", "allow_license_changes", \ @@ -4129,7 +4129,7 @@ class depgraph(object): return False for key in Package._dep_keys + ("LICENSE",): - dep = pkg.metadata[key] + dep = pkg._metadata[key] old_val = set(portage.dep.use_reduce(dep, pkg.use.enabled, is_valid_flag=pkg.iuse.is_valid_flag, flat=True)) new_val = set(portage.dep.use_reduce(dep, new_use, is_valid_flag=pkg.iuse.is_valid_flag, flat=True)) @@ -4152,7 +4152,7 @@ class depgraph(object): if new_changes != old_changes: #Don't do the change if it violates REQUIRED_USE. - required_use = pkg.metadata.get("REQUIRED_USE") + required_use = pkg._metadata.get("REQUIRED_USE") if required_use and check_required_use(required_use, old_use, pkg.iuse.is_valid_flag, eapi=pkg.eapi) and \ not check_required_use(required_use, new_use, @@ -4317,8 +4317,8 @@ class depgraph(object): for selected_pkg in matched_packages: if selected_pkg.type_name == "binary" and \ selected_pkg.cpv == pkg.cpv and \ - selected_pkg.metadata.get('BUILD_TIME') == \ - pkg.metadata.get('BUILD_TIME'): + selected_pkg._metadata.get('BUILD_TIME') == \ + pkg._metadata.get('BUILD_TIME'): identical_binary = True break @@ -4552,12 +4552,12 @@ class depgraph(object): # bug #306659 where BUILD_TIME fields are missing # in local and/or remote Packages file. try: - built_timestamp = int(built_pkg.metadata['BUILD_TIME']) + built_timestamp = int(built_pkg._metadata['BUILD_TIME']) except (KeyError, ValueError): built_timestamp = 0 try: - installed_timestamp = int(inst_pkg.metadata['BUILD_TIME']) + installed_timestamp = int(inst_pkg._metadata['BUILD_TIME']) except (KeyError, ValueError): installed_timestamp = 0 @@ -5157,7 +5157,7 @@ class depgraph(object): for inst_pkg, inst_task in depends_on_order: uninst_task = Package(built=inst_pkg.built, cpv=inst_pkg.cpv, installed=inst_pkg.installed, - metadata=inst_pkg.metadata, + metadata=inst_pkg._metadata, operation="uninstall", root_config=inst_pkg.root_config, type_name=inst_pkg.type_name) @@ -5475,7 +5475,7 @@ class depgraph(object): if running_portage is not None: try: portage_rdepend = self._select_atoms_highest_available( - running_root, running_portage.metadata["RDEPEND"], + running_root, running_portage._metadata["RDEPEND"], myuse=self._pkg_use_enabled(running_portage), parent=running_portage, strict=False) except portage.exception.InvalidDependString as e: @@ -6030,7 +6030,7 @@ class depgraph(object): inst_pkg = inst_pkg[0] uninst_task = Package(built=inst_pkg.built, cpv=inst_pkg.cpv, installed=inst_pkg.installed, - metadata=inst_pkg.metadata, + metadata=inst_pkg._metadata, operation="uninstall", root_config=inst_pkg.root_config, type_name=inst_pkg.type_name) @@ -6362,7 +6362,7 @@ class depgraph(object): keyword = reason.unmask_hint.value comment, filename = portage.getmaskingreason( - pkg.cpv, metadata=pkg.metadata, + pkg.cpv, metadata=pkg._metadata, settings=pkgsettings, portdb=pkg.root_config.trees["porttree"].dbapi, return_location=True) @@ -6741,7 +6741,7 @@ class depgraph(object): pkgsettings = self._frozen_config.pkgsettings[pkg.root] mreasons = get_masking_status(pkg, pkgsettings, root_config, use=self._pkg_use_enabled(pkg)) masked_packages.append((root_config, pkgsettings, - pkg.cpv, pkg.repo, pkg.metadata, mreasons)) + pkg.cpv, pkg.repo, pkg._metadata, mreasons)) if masked_packages: writemsg("\n" + colorize("BAD", "!!!") + \ " The following updates are masked by LICENSE changes:\n", @@ -6756,7 +6756,7 @@ class depgraph(object): pkgsettings = self._frozen_config.pkgsettings[pkg.root] mreasons = get_masking_status(pkg, pkgsettings, root_config, use=self._pkg_use_enabled) masked_packages.append((root_config, pkgsettings, - pkg.cpv, pkg.repo, pkg.metadata, mreasons)) + pkg.cpv, pkg.repo, pkg._metadata, mreasons)) if masked_packages: writemsg("\n" + colorize("BAD", "!!!") + \ " The following installed packages are masked:\n", @@ -7253,7 +7253,7 @@ class _dep_check_composite_db(dbapi): return True def aux_get(self, cpv, wants): - metadata = self._cpv_pkg_map[cpv].metadata + metadata = self._cpv_pkg_map[cpv]._metadata return [metadata.get(x, "") for x in wants] def match_pkgs(self, atom): @@ -7605,9 +7605,9 @@ def _get_masking_status(pkg, pkgsettings, root_config, myrepo=None, use=None): portdb=root_config.trees["porttree"].dbapi, myrepo=myrepo) if not pkg.installed: - if not pkgsettings._accept_chost(pkg.cpv, pkg.metadata): + if not pkgsettings._accept_chost(pkg.cpv, pkg._metadata): mreasons.append(_MaskReason("CHOST", "CHOST: %s" % \ - pkg.metadata["CHOST"])) + pkg._metadata["CHOST"])) if pkg.invalid: for msgs in pkg.invalid.values(): @@ -7615,7 +7615,7 @@ def _get_masking_status(pkg, pkgsettings, root_config, myrepo=None, use=None): mreasons.append( _MaskReason("invalid", "invalid: %s" % (msg,))) - if not pkg.metadata["SLOT"]: + if not pkg._metadata["SLOT"]: mreasons.append( _MaskReason("invalid", "SLOT: undefined")) diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py index 76c7b3afb..52561239e 100644 --- a/pym/_emerge/resolver/circular_dependency.py +++ b/pym/_emerge/resolver/circular_dependency.py @@ -114,10 +114,10 @@ class circular_dependency_handler(object): parent_atoms = self.all_parent_atoms.get(pkg) if priorities[-1].buildtime: - dep = " ".join(parent.metadata[k] + dep = " ".join(parent._metadata[k] for k in Package._buildtime_keys) elif priorities[-1].runtime: - dep = parent.metadata["RDEPEND"] + dep = parent._metadata["RDEPEND"] for ppkg, atom in parent_atoms: if ppkg == parent: @@ -146,7 +146,7 @@ class circular_dependency_handler(object): #If any of the flags we're going to touch is in REQUIRED_USE, add all #other flags in REQUIRED_USE to affecting_use, to not lose any solution. required_use_flags = get_required_use_flags( - parent.metadata.get("REQUIRED_USE", ""), + parent._metadata.get("REQUIRED_USE", ""), eapi=parent.eapi) if affecting_use.intersection(required_use_flags): @@ -189,7 +189,7 @@ class circular_dependency_handler(object): parent_atom not in reduced_dep: #We found an assignment that removes the atom from 'dep'. #Make sure it doesn't conflict with REQUIRED_USE. - required_use = parent.metadata.get("REQUIRED_USE", "") + required_use = parent._metadata.get("REQUIRED_USE", "") if check_required_use(required_use, current_use, parent.iuse.is_valid_flag, diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index cfacab149..1fdc08def 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -651,7 +651,7 @@ class Display(object): pkg_info.repo_path_real = self.portdb.getRepositoryPath(pkg.repo) pkg_info.use = list(self.conf.pkg_use_enabled(pkg)) if not pkg.built and pkg.operation == 'merge' and \ - 'fetch' in pkg.metadata.restrict: + 'fetch' in pkg._metadata.restrict: if pkg_info.ordered: self.counters.restrict_fetch += 1 pkg_info.attr_display.fetch_restrict = True @@ -853,7 +853,7 @@ class Display(object): pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info) pkg_info.system, pkg_info.world = \ self.check_system_world(pkg) - if 'interactive' in pkg.metadata.properties and \ + if 'interactive' in pkg._metadata.properties and \ pkg.operation == 'merge': pkg_info.attr_display.interactive = True if ordered: diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py index c2b04d58c..e04166b81 100644 --- a/pym/_emerge/resolver/slot_collision.py +++ b/pym/_emerge/resolver/slot_collision.py @@ -872,7 +872,7 @@ class slot_conflict_handler(object): #Make sure the changes don't violate REQUIRED_USE for pkg in required_changes: - required_use = pkg.metadata.get("REQUIRED_USE") + required_use = pkg._metadata.get("REQUIRED_USE") if not required_use: continue diff --git a/pym/portage/_sets/base.py b/pym/portage/_sets/base.py index c8d3ae405..d368e00b6 100644 --- a/pym/portage/_sets/base.py +++ b/pym/portage/_sets/base.py @@ -126,7 +126,7 @@ class PackageSet(object): if modified_use is not None and modified_use is not pkg.use.enabled: pkg = pkg.copy() - pkg.metadata["USE"] = " ".join(modified_use) + pkg._metadata["USE"] = " ".join(modified_use) # Atoms matched via PROVIDE must be temporarily transformed since # match_from_list() only works correctly when atom.cp == pkg.cp. @@ -156,7 +156,7 @@ class PackageSet(object): for atom in atoms: if match_from_list(atom, cpv_slot_list): yield atom - provides = pkg.metadata['PROVIDE'] + provides = pkg._metadata['PROVIDE'] if not provides: return provides = provides.split() diff --git a/pym/portage/dep/_slot_operator.py b/pym/portage/dep/_slot_operator.py index 1fdf904a1..2fcfb48b3 100644 --- a/pym/portage/dep/_slot_operator.py +++ b/pym/portage/dep/_slot_operator.py @@ -9,7 +9,7 @@ from _emerge.Package import Package def find_built_slot_operator_atoms(pkg): atoms = {} for k in Package._dep_keys: - atom_list = list(_find_built_slot_operator(use_reduce(pkg.metadata[k], + atom_list = list(_find_built_slot_operator(use_reduce(pkg._metadata[k], uselist=pkg.use.enabled, eapi=pkg.eapi, token_class=Atom))) if atom_list: diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index 006e084df..b5f8d0d7e 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -160,7 +160,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", # According to GLEP 37, RDEPEND is the only dependency # type that is valid for new-style virtuals. Repoman # should enforce this. - depstring = pkg.metadata['RDEPEND'] + depstring = pkg._metadata['RDEPEND'] pkg_kwargs = kwargs.copy() pkg_kwargs["myuse"] = pkg_use_enabled(pkg) if edebug: diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 86eac8a52..75fc1de8d 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1248,7 +1248,7 @@ class config(object): if not isinstance(mycpv, basestring): pkg = mycpv mycpv = pkg.cpv - mydb = pkg.metadata + mydb = pkg._metadata explicit_iuse = pkg.iuse.all args_hash = (mycpv, id(pkg)) if pkg.built: diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index a1f27db9d..d737e66e0 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -1334,9 +1334,9 @@ def _validate_deps(mysettings, myroot, mydo, mydbapi): if not pkg.built and \ mydo not in ("digest", "help", "manifest") and \ - pkg.metadata["REQUIRED_USE"] and \ + pkg._metadata["REQUIRED_USE"] and \ eapi_has_required_use(pkg.eapi): - result = check_required_use(pkg.metadata["REQUIRED_USE"], + result = check_required_use(pkg._metadata["REQUIRED_USE"], pkg.use.enabled, pkg.iuse.is_valid_flag, eapi=pkg.eapi) if not result: reduced_noise = result.tounicode() @@ -1345,7 +1345,7 @@ def _validate_deps(mysettings, myroot, mydo, mydbapi): writemsg(" %s\n" % reduced_noise, noiselevel=-1) normalized_required_use = \ - " ".join(pkg.metadata["REQUIRED_USE"].split()) + " ".join(pkg._metadata["REQUIRED_USE"].split()) if reduced_noise != normalized_required_use: writemsg("\n %s\n" % _("The above constraints " + \ "are a subset of the following complete expression:"), diff --git a/pym/portage/package/ebuild/getmaskingstatus.py b/pym/portage/package/ebuild/getmaskingstatus.py index 954abced9..4dbe6a970 100644 --- a/pym/portage/package/ebuild/getmaskingstatus.py +++ b/pym/portage/package/ebuild/getmaskingstatus.py @@ -48,7 +48,7 @@ def _getmaskingstatus(mycpv, settings, portdb, myrepo=None): # emerge passed in a Package instance pkg = mycpv mycpv = pkg.cpv - metadata = pkg.metadata + metadata = pkg._metadata installed = pkg.installed if metadata is None: