Пример #1
0
 def __make_package_pipdist(self, dist):
     p = Package(self)
     p.id = '%s==%s' % (dist.key, dist.version)
     p.name = dist.key
     p.version = dist.version
     p.description = None
     p.is_installed = True
     p.installed_version = dist.version
     return p
Пример #2
0
 def __make_package(self, dist):
     p = Package(self)
     p.id = '%s==%s' % (dist['name'], dist['version'])
     p.name = dist['name']
     p.version = dist['version']
     p.description = dist['summary']
     for d in pkg_resources.working_set:
         if d.key == p.name:
             p.is_installed = True
             p.installed_version = d.version
             p.is_upgradeable = p.installed_version != p.version
     return p
Пример #3
0
 def __make_package(self, pkg):
     pkg_installed = (self.yum.rpmdb.searchNames(names=[pkg.name]) or [None])[0]
     p = Package(self)
     p.id = '%s.%s' % (pkg.name, pkg.arch)
     p.name = pkg.name
     p.version = pkg.version
     p.description = pkg.arch  # nothing better
     p.is_installed = pkg_installed is not None
     if p.is_installed:
         p.installed_version = pkg_installed.version
         p.is_upgradeable = p.installed_version != p.version
     return p
Пример #4
0
 def __make_package(self, dist):
     p = Package(self)
     p.id = '%s==%s' % (dist['name'], dist['version'])
     p.name = dist['name']
     p.version = dist['version']
     p.description = dist['summary']
     for d in pip.get_installed_distributions():
         if d.key == p.name:
             p.is_installed = True
             p.installed_version = d.version
             p.is_upgradeable = p.installed_version != p.version
     return p
Пример #5
0
 def __make_package(self, dist):
     p = Package(self)
     p.id = '%s==%s' % (dist['name'], dist['version'])
     p.name = dist['name']
     p.version = dist['version']
     p.description = dist['summary']
     for d in pip.get_installed_distributions():
         if d.key == p.name:
             p.is_installed = True
             p.installed_version = d.version
             p.is_upgradeable = p.installed_version != p.version
     return p
Пример #6
0
 def __make_package(self, apt_package):
     p = Package(self)
     p.id = apt_package.fullname if hasattr(apt_package, 'fullname') else apt_package.name
     p.name = p.id
     v = apt_package.versions[-1]
     p.version = v.version
     p.description = v.summary
     p.is_installed = apt_package.installed is not None
     if p.is_installed:
         p.installed_version = apt_package.installed.version
         p.is_upgradeable = p.installed_version != p.version
     return p
Пример #7
0
 def __make_package(self, pkg):
     pkg_installed = (self.yum.rpmdb.searchNames(names=[pkg.name]) or [None])[0]
     p = Package(self)
     p.id = '%s.%s' % (pkg.name, pkg.arch)
     p.name = pkg.name
     p.version = pkg.version
     p.description = pkg.arch  # nothing better
     p.is_installed = pkg_installed is not None
     if p.is_installed:
         p.installed_version = pkg_installed.version
         p.is_upgradeable = p.installed_version != p.version
     return p
Пример #8
0
 def __make_package(self, apt_package):
     p = Package(self)
     p.id = apt_package.fullname if hasattr(
         apt_package, 'fullname') else apt_package.name
     p.name = p.id
     v = apt_package.versions[-1]
     p.version = v.version
     p.description = v.summary
     p.is_installed = apt_package.installed is not None
     if p.is_installed:
         p.installed_version = apt_package.installed.version
         p.is_upgradeable = p.installed_version != p.version
     return p
Пример #9
0
    def __make_package_pipdist(self, dist):
        """
        Convert pip package object in package object.

        :param apt_package: Pip package object from apt module
        :type apt_package: Pip package object from apt module
        :return: Package object
        :rtype: Package object
        """

        p = Package(self)
        p.id = f'{dist.key}=={dist.version}'
        p.name = dist.key
        p.version = dist.version
        p.description = None
        p.is_installed = True
        p.installed_version = dist.version
        return p
Пример #10
0
    def __make_package(self, pkg):
        """
        Convert yum package object in package object.

        :param apt_package: Yum package object from apt module
        :type apt_package: Yum package object from apt module
        :return: Package object
        :rtype: Package object
        """

        pkg_installed = (self.yum.rpmdb.searchNames(names=[pkg.name]) or [None])[0]
        p = Package(self)
        p.id = f'{pkg.name}.{pkg.arch}'
        p.name = pkg.name
        p.version = pkg.version
        p.description = pkg.arch  # nothing better
        p.is_installed = pkg_installed is not None
        if p.is_installed:
            p.installed_version = pkg_installed.version
            p.is_upgradeable = p.installed_version != p.version
        return p
Пример #11
0
    def __make_package(self, apt_package):
        """
        Convert apt package object in package object.

        :param apt_package: Apt package object from apt module
        :type apt_package: Apt package object from apt module
        :return: Package object
        :rtype: Package object
        """

        p = Package(self)
        p.id = apt_package.fullname if hasattr(
            apt_package, 'fullname') else apt_package.name
        p.name = p.id
        v = apt_package.versions[-1]
        p.version = v.version
        p.description = v.summary
        p.is_installed = apt_package.installed is not None
        if p.is_installed:
            p.installed_version = apt_package.installed.version
            p.is_upgradeable = p.installed_version != p.version
        return p
Пример #12
0
    def __make_package(self, dist):
        """
        Convert pip package object in package object.

        :param apt_package: Pip package object from apt module
        :type apt_package: Pip package object from apt module
        :return: Package object
        :rtype: Package object
        """

        p = Package(self)
        p.id = '%s==%s' % (dist['name'], dist['version'])
        p.name = dist['name']
        p.version = dist['version']
        p.description = dist['summary']
        importlib.reload(pkg_resources)
        for d in pkg_resources.working_set:
            if d.key == p.name:
                p.is_installed = True
                p.installed_version = d.version
                p.is_upgradeable = p.installed_version != p.version
        return p