Ejemplo n.º 1
0
    def get_masking_reason(self):
        reason = portage.getmaskingreason(self.get_cpv(), settings = self._settings.settings)

        if reason:
            return reason.strip()
        else:
            return reason
Ejemplo n.º 2
0
def masking_reason(Package, version):
    return portage.getmaskingreason(
        "%s/%s-%s" % (Package.category, Package.package, version),
        settings=SETTINGS,
        metadata=self._env,
        return_location=True,
        myrepo=Package.repository
    )
 def mask_reason(self):
     reas, in_file = portage.getmaskingreason(self.cpv,
                                              metadata = self._env,
                                              return_location=True,
                              myrepo = self.package.category.porttree_name)
     if in_file is None:
         return None
     elif in_file.startswith('/etc/portage/'):
         return None
     else:
         return reas
Ejemplo n.º 4
0
	def mask_reason(self):
		"""Shortcut to L{portage.getmaskingreason}.

		@rtype: None or tuple
		@return: empty tuple if pkg not masked OR
			('mask reason', 'mask location')
		"""

		try:
			result = portage.getmaskingreason(self.cpv,
				settings=self._settings,
				portdb=portage.db[portage.root]["porttree"].dbapi,
				return_location=True)
			if result is None:
				result = tuple()
		except KeyError:
			# getmaskingstatus doesn't support packages without ebuilds in the
			# Portage tree.
			result = None

		return result