Make the visibility related config methods such as getMaskAtom() and
authorZac Medico <zmedico@gentoo.org>
Fri, 20 Jun 2008 13:39:14 +0000 (13:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 20 Jun 2008 13:39:14 +0000 (13:39 -0000)
getProfileMaskAtom() private since these methods really should take
Package instances before we expose them as public api.

svn path=/main/trunk/; revision=10739

pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/porttree.py

index 999bd9e3316e96afa2c9dcdfd0fe8866884f329e..f918d20ac84446d5668bb343cae51cbd9a59a96f 100644 (file)
@@ -1120,14 +1120,14 @@ def visible(pkgsettings, pkg):
        if not portage.eapi_is_supported(pkg.metadata["EAPI"]):
                return False
        if not pkg.installed and \
-               pkgsettings.getMissingKeywords(pkg.cpv, pkg.metadata):
+               pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata):
                return False
-       if pkgsettings.getMaskAtom(pkg.cpv, pkg.metadata):
+       if pkgsettings._getMaskAtom(pkg.cpv, pkg.metadata):
                return False
-       if pkgsettings.getProfileMaskAtom(pkg.cpv, pkg.metadata):
+       if pkgsettings._getProfileMaskAtom(pkg.cpv, pkg.metadata):
                return False
        try:
-               if pkgsettings.getMissingLicenses(pkg.cpv, pkg.metadata):
+               if pkgsettings._getMissingLicenses(pkg.cpv, pkg.metadata):
                        return False
        except portage.exception.InvalidDependString:
                return False
@@ -1194,7 +1194,7 @@ def show_masked_packages(masked_packages):
                                have_eapi_mask = True
                        try:
                                missing_licenses = \
-                                       pkgsettings.getMissingLicenses(
+                                       pkgsettings._getMissingLicenses(
                                                cpv, metadata)
                        except portage.exception.InvalidDependString:
                                # This will have already been reported
@@ -3196,7 +3196,7 @@ class depgraph(object):
                                                # reinstall the same exact version only due
                                                # to a KEYWORDS mask.
                                                if installed and matched_packages and \
-                                                       pkgsettings.getMissingKeywords(
+                                                       pkgsettings._getMissingKeywords(
                                                        pkg.cpv, pkg.metadata):
                                                        different_version = None
                                                        for avail_pkg in matched_packages:
@@ -3545,7 +3545,7 @@ class depgraph(object):
                                                if pkg_in_graph and not visible(pkgsettings, pkg):
                                                        self._masked_installed.add(pkg)
                                                elif graph_complete_for_root and \
-                                                       pkgsettings.getMissingKeywords(
+                                                       pkgsettings._getMissingKeywords(
                                                        pkg.cpv, pkg.metadata) and \
                                                        pkg.metadata["KEYWORDS"].split() and \
                                                        not pkg_in_graph:
@@ -5674,7 +5674,7 @@ class depgraph(object):
                        try:
                                if visible(root_config.settings, v) and \
                                        not (v.installed and \
-                                       v.root_config.settings.getMissingKeywords(v.cpv, v.metadata)):
+                                       v.root_config.settings._getMissingKeywords(v.cpv, v.metadata)):
                                        root_config.visible_pkgs.cpv_inject(v)
                        except portage.exception.InvalidDependString:
                                pass
index 901edf9240143411151b82c875c6afff5dab5b19..b3c37d60db5562dbb0903d8b0f2410b98e71a0c8 100644 (file)
@@ -2191,7 +2191,7 @@ class config(object):
                iuse_implicit.add("bootstrap")
                return iuse_implicit
 
-       def getMaskAtom(self, cpv, metadata):
+       def _getMaskAtom(self, cpv, metadata):
                """
                Take a package and return a matching package.mask atom, or None if no
                such atom exists or it has been cancelled by package.unmask. PROVIDE
@@ -2220,7 +2220,7 @@ class config(object):
                                return x
                return None
 
-       def getProfileMaskAtom(self, cpv, metadata):
+       def _getProfileMaskAtom(self, cpv, metadata):
                """
                Take a package and return a matching profile atom, or None if no
                such atom exists. Note that a profile atom may or may not have a "*"
@@ -2245,7 +2245,7 @@ class config(object):
                                return x
                return None
 
-       def getMissingKeywords(self, cpv, metadata):
+       def _getMissingKeywords(self, cpv, metadata):
                """
                Take a package and return a list of any KEYWORDS that the user may
                may need to accept for the given package. If the KEYWORDS are empty
@@ -2322,7 +2322,7 @@ class config(object):
                        missing = mygroups
                return missing
 
-       def getMissingLicenses(self, cpv, metadata):
+       def _getMissingLicenses(self, cpv, metadata):
                """
                Take a LICENSE string and return a list any licenses that the user may
                may need to accept for the given package.  The returned list will not
@@ -2349,9 +2349,9 @@ class config(object):
                license_struct = portage.dep.use_reduce(
                        license_struct, uselist=metadata["USE"].split())
                license_struct = portage.dep.dep_opconvert(license_struct)
-               return self._getMissingLicenses(license_struct, acceptable_licenses)
+               return self._getMaskedLicenses(license_struct, acceptable_licenses)
 
-       def _getMissingLicenses(self, license_struct, acceptable_licenses):
+       def _getMaskedLicenses(self, license_struct, acceptable_licenses):
                if not license_struct:
                        return []
                if license_struct[0] == "||":
@@ -2359,7 +2359,7 @@ class config(object):
                        for element in license_struct[1:]:
                                if isinstance(element, list):
                                        if element:
-                                               ret.append(self._getMissingLicenses(
+                                               ret.append(self._getMaskedLicenses(
                                                        element, acceptable_licenses))
                                                if not ret[-1]:
                                                        return []
@@ -2375,7 +2375,7 @@ class config(object):
                for element in license_struct:
                        if isinstance(element, list):
                                if element:
-                                       ret.extend(self._getMissingLicenses(element,
+                                       ret.extend(self._getMaskedLicenses(element,
                                                acceptable_licenses))
                        else:
                                if element not in acceptable_licenses:
@@ -6349,11 +6349,11 @@ def getmaskingstatus(mycpv, settings=None, portdb=None):
        rValue = []
 
        # profile checking
-       if settings.getProfileMaskAtom(mycpv, metadata):
+       if settings._getProfileMaskAtom(mycpv, metadata):
                rValue.append("profile")
 
        # package.mask checking
-       if settings.getMaskAtom(mycpv, metadata):
+       if settings._getMaskAtom(mycpv, metadata):
                rValue.append("package.mask")
 
        # keywords checking
@@ -6418,7 +6418,7 @@ def getmaskingstatus(mycpv, settings=None, portdb=None):
                                break
 
        try:
-               missing_licenses = settings.getMissingLicenses(mycpv, metadata)
+               missing_licenses = settings._getMissingLicenses(mycpv, metadata)
                if missing_licenses:
                        allowed_tokens = set(["||", "(", ")"])
                        allowed_tokens.update(missing_licenses)
index d6d5657c346dc2d7ae966521ca47f34dab2264f2..3c27c2d95892e492b4c04fea28e67023ed8134c8 100644 (file)
@@ -654,11 +654,11 @@ class portdbapi(dbapi):
                                        continue
                                if mydep.slot and mydep.slot != metadata["SLOT"]:
                                        continue
-                               if settings.getMissingKeywords(cpv, metadata):
+                               if settings._getMissingKeywords(cpv, metadata):
                                        continue
-                               if settings.getMaskAtom(cpv, metadata):
+                               if settings._getMaskAtom(cpv, metadata):
                                        continue
-                               if settings.getProfileMaskAtom(cpv, metadata):
+                               if settings._getProfileMaskAtom(cpv, metadata):
                                        continue
                                if local_config:
                                        metadata["USE"] = ""
@@ -666,7 +666,7 @@ class portdbapi(dbapi):
                                                self.doebuild_settings.setcpv(cpv, mydb=metadata)
                                                metadata["USE"] = self.doebuild_settings.get("USE", "")
                                        try:
-                                               if settings.getMissingLicenses(cpv, metadata):
+                                               if settings._getMissingLicenses(cpv, metadata):
                                                        continue
                                        except InvalidDependString:
                                                continue
@@ -721,8 +721,8 @@ class portdbapi(dbapi):
 
                db_keys = ["SLOT"]
                visible = []
-               getMaskAtom = self.mysettings.getMaskAtom
-               getProfileMaskAtom = self.mysettings.getProfileMaskAtom
+               getMaskAtom = self.mysettings._getMaskAtom
+               getProfileMaskAtom = self.mysettings._getProfileMaskAtom
                for cpv in mylist:
                        try:
                                metadata = dict(izip(db_keys, self.aux_get(cpv, db_keys)))
@@ -761,7 +761,7 @@ class portdbapi(dbapi):
                                continue
                        if not eapi_is_supported(metadata["EAPI"]):
                                continue
-                       if self.mysettings.getMissingKeywords(mycpv, metadata):
+                       if self.mysettings._getMissingKeywords(mycpv, metadata):
                                continue
                        if local_config:
                                metadata["USE"] = ""
@@ -769,7 +769,7 @@ class portdbapi(dbapi):
                                        self.doebuild_settings.setcpv(mycpv, mydb=metadata)
                                        metadata["USE"] = self.doebuild_settings.get("USE", "")
                                try:
-                                       if self.mysettings.getMissingLicenses(mycpv, metadata):
+                                       if self.mysettings._getMissingLicenses(mycpv, metadata):
                                                continue
                                except InvalidDependString:
                                        continue