Ejemplo n.º 1
0
    def is_valid_portage_license(cls, license):
        """
        Check if license string matches a valid one in ${PORTDIR}/licenses

        :param license: Portage license name
        :type license: string
        :returns: True if license is valid/exists
        :rtype: bool

        **Example:**

        >>> Enamer.is_valid_portage_license("KQEMU")
        True
        >>> Enamer.is_valid_portage_license("foobar")
        False

        """
        return os.path.exists(os.path.join(PortageUtils.get_portdir(), "licenses", license))
Ejemplo n.º 2
0
    def is_valid_portage_license(cls, license):
        """
        Check if license string matches a valid one in ${PORTDIR}/licenses

        :param license: Portage license name
        :type license: string
        :returns: True if license is valid/exists
        :rtype: bool

        **Example:**

        >>> Enamer.is_valid_portage_license("KQEMU")
        True
        >>> Enamer.is_valid_portage_license("foobar")
        False

        """
        return os.path.exists(
            os.path.join(PortageUtils.get_portdir(), "licenses", license))