コード例 #1
0
ファイル: package.py プロジェクト: Necoro/portato
    def get_masking_reason(self):
        reason = portage.getmaskingreason(self.get_cpv(), settings = self._settings.settings)

        if reason:
            return reason.strip()
        else:
            return reason
コード例 #2
0
ファイル: pkgcore_lib.py プロジェクト: VentGrey/chrysalis
def get_masking_reason(ebuild):
    """Strips trailing \n from, and returns the masking reason given by portage"""
    reason = portage.getmaskingreason(ebuild)
    if not reason: return _('No masking reason given')
    if reason.endswith("\n"):
        reason = reason[:-1]
    return reason
コード例 #3
0
    def get_masking_reason(self):
        reason = portage.getmaskingreason(self.get_cpv(),
                                          settings=self._settings.settings)

        if reason:
            return reason.strip()
        else:
            return reason
コード例 #4
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
    )
コード例 #5
0
def get_masking_reason(ebuild):
    """Strips trailing \n from, and returns the masking reason given by portage"""
    reason, location = portage.getmaskingreason(ebuild, settings=settings.settings, portdb=settings.portdb,  return_location=True)
    if not reason: return _('No masking reason given')
    if location != None:
        reason += "in file: " + location
    if reason.endswith("\n"):
        reason = reason[:-1]
    return reason
コード例 #6
0
 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
コード例 #7
0
def get_masking_reason(ebuild):
    """Strips trailing \n from, and returns the masking reason given by portage"""
    reason, location = portage.getmaskingreason(ebuild,
                                                settings=settings.settings,
                                                portdb=settings.portdb,
                                                return_location=True)
    if not reason:
        reason = _('No masking reason given.')
        status = get_masking_status(ebuild)
        if 'profile' in status:
            reason = _("Masked by the current profile.")
            status.remove('profile')
        if status:
            reason += " from " + ', '.join(status)
    if location != None:
        reason += "in file: " + location
    if reason.endswith("\n"):
        reason = reason[:-1]
    return reason
コード例 #8
0
ファイル: package.py プロジェクト: zmedico/gentoolkit
	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
コード例 #9
0
ファイル: package.py プロジェクト: pamxy/gentoolkit
	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