Rename Package.metadata to _metadata.
authorZac Medico <zmedico@gentoo.org>
Tue, 27 Nov 2012 04:37:41 +0000 (20:37 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 27 Nov 2012 04:37:41 +0000 (20:37 -0800)
The raw metadata is considered a private low-level internal. This
makes the Package class consistent with the _pkg_str class.

17 files changed:
bin/repoman
pym/_emerge/BlockerDB.py
pym/_emerge/EbuildBuild.py
pym/_emerge/Package.py
pym/_emerge/PackageVirtualDbapi.py
pym/_emerge/Scheduler.py
pym/_emerge/actions.py
pym/_emerge/depgraph.py
pym/_emerge/resolver/circular_dependency.py
pym/_emerge/resolver/output.py
pym/_emerge/resolver/slot_collision.py
pym/portage/_sets/base.py
pym/portage/dep/_slot_operator.py
pym/portage/dep/dep_check.py
pym/portage/package/ebuild/config.py
pym/portage/package/ebuild/doebuild.py
pym/portage/package/ebuild/getmaskingstatus.py

index 7ecdc6d199c91f1424e19d317e1c55e0f8166b23..a38ffe121b21a19d2c3de1d9150683592132e8ae 100755 (executable)
@@ -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
index ce8806d91fb15138002be798437b612ab8d3c0b0..8bb8f5fdadcd4413c249a0c85765dd604198a4d4 100644 (file)
@@ -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)
index 784a3e298cd64313300af85700c0f715715456b8..2da09e7f3f93f01eb2b6e6672115bc69b71710df 100644 (file)
@@ -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
index f73fe82f3d2cc8f55c94b2e3122722fa3a278640..7950ffb815fd7ce7b444ce54f74e416e0f113a53 100644 (file)
@@ -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):
index 0f7be44b1c69daabc383a90a027c80b323c0de25..56a5576e37693fe0e64c10884644e29d344e016d 100644 (file)
@@ -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()
 
index ff2938020f53ed33e4022ab22d5cafdc5147d59e..72f1943e8d29358427bc4f80a6ecc0d5a5a8881e 100644 (file)
@@ -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"
index cd52ddb1b25f727a93abc6b66d6e6e7ef7439674..b64614e1d6a93d09dfc8e979cb1fe34e82759cd9 100644 (file)
@@ -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]
index df49143161db281e971d0109d7afaf240a460597..702f7fe0413567a2df64e2eadb3a9cb47db7bebd 100644 (file)
@@ -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"))
 
index 76c7b3afb0565a7d220d3db517845dd4966c690d..52561239e249dc72ec4b8b9c0df862d5194cf808 100644 (file)
@@ -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,
index cfacab1494d4c7d048ce037755b38079643dfcb9..1fdc08def0e3920383f1fc0245a756221d46f9a9 100644 (file)
@@ -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:
index c2b04d58c1dfcc4d62f93e9f933c97a669e5a538..e04166b81d440f83453c1124f321cc2b67681a50 100644 (file)
@@ -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
 
index c8d3ae4059ac484d05ef35a767431053ca97cc43..d368e00b6a65e3b0ce03c53b7790d03a349e91d6 100644 (file)
@@ -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()
index 1fdf904a11e27f06d6e7f9adc6f7974eb8a3cf11..2fcfb48b3e8be45d9096b038ced0815d0ab2fbb1 100644 (file)
@@ -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:
index 006e084df3996084eb5f66518e487f8dc0153f72..b5f8d0d7ed14a1914788aedd61cd524b918c7008 100644 (file)
@@ -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:
index 86eac8a5269eee088a58df31ba5d25f9f221f9d2..75fc1de8d64518bbf85d378c26aee003d8820be2 100644 (file)
@@ -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:
index a1f27db9dc5aaf417990598f72da61b5e20460b3..d737e66e06832addd7512c094026e15a86e589c1 100644 (file)
@@ -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:"),
index 954abced96f980cd1fc5acb3e733b172e74c5665..4dbe6a970cad51a52fb807bb99b2f3941e7b949e 100644 (file)
@@ -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: