Exemplo n.º 1
0
    def notify(self):
        """
        Overridden from BaseAntiMatterResult
        """
        for package in self._result:

            if self._nsargs.extended:
                cp = package.key()
                slot = package.slot()

                from_ver = "x"
                inst = package.installed()
                if inst is not None:
                    from_ver = inst.version

                to_ver = "x"
                avail = package.available()
                if avail is not None:
                    to_ver = avail.version

                name = "%s:%s  [%s->%s]" % (darkgreen(cp), brown(slot),
                                            teal(from_ver), purple(to_ver))

            elif self._nsargs.verbose:
                name = package.target()
            else:
                name = package.keyslot()

            if self._nsargs.quiet:
                print_generic(name)
            else:
                print_info(name)
Exemplo n.º 2
0
    def notify(self):
        """
        Overridden from BaseAntiMatterResult
        """
        for package in self._result:

            if self._nsargs.extended:
                cp = package.key()
                slot = package.slot()

                from_ver = "x"
                inst = package.installed()
                if inst is not None:
                    from_ver = inst.version

                to_ver = "x"
                avail = package.available()
                if avail is not None:
                    to_ver = avail.version

                name = "%s:%s  [%s->%s]" % (
                    darkgreen(cp),
                    brown(slot),
                    teal(from_ver),
                    purple(to_ver))

            elif self._nsargs.verbose:
                name = package.target()
            else:
                name = package.keyslot()

            if self._nsargs.quiet:
                print_generic(name)
            else:
                print_info(name)
Exemplo n.º 3
0
def _show_kernel_warnings(kernel_atom):
    print_info("%s %s" % (purple(kernel_atom), teal(_("has been installed."))))
    print_warning(
        "%s: %s" %
        (red(_("Attention")),
         brown(
             _("some external drivers cannot work across multiple kernels."))))
    print_warning(darkgreen(_("Please reboot your computer now !")))
Exemplo n.º 4
0
    def _get_installed_kernels(self, installed_repository):
        """
        Return a set of kernel packages that are installed on the system.
        """
        installed_package_ids = set()
        # Resolve the target kernel using the installed packages repository.
        # First, locate the virtual kernel package (if new virtuals are in
        # use.)
        latest_kernel, _k_rc = installed_repository.atomMatch(
            KERNEL_BINARY_VIRTUAL)
        if latest_kernel == -1:
            # Virtual package is not installed.
            # This happens when kernel packages have been moved to the new
            # virtual and PROVIDE is broken or no longer supported (EAPI=7?).
            print_warning("%s: %s %s" % (
                red(_("Attention")), KERNEL_BINARY_VIRTUAL,
                brown(
                    _("is not installed. Unable to resolve kernel "
                      "packages correctly. Please use --from-running or install"
                      "the package. Is your system up-to-date?"))))
            return installed_package_ids

        # If we have resolved the package to the virtual, we need to go
        # one level deep and retrieve the list of available kernel packages.
        # Do not assume that we hit only one kernel package when scanning, we
        # may have different packages in the dependency list.
        virtual_key = entropy.dep.dep_getkey(KERNEL_BINARY_VIRTUAL)
        latest_key_slot = installed_repository.retrieveKeySlot(latest_kernel)
        if latest_key_slot:
            latest_key, _unused = latest_key_slot
        else:
            # Cannot find installed package, give up.
            print_warning("%s: %s" % (
                red(_("Attention")),
                brown(
                    _("Unable to resolve the latest kernel metadata. Try again later."
                      ))))
            return installed_package_ids

        if virtual_key == latest_key:
            print_info("%s: %s" % (
                red(_("Resolving virtual kernel package")),
                KERNEL_BINARY_VIRTUAL,
            ))
            # New virtual package support.
            virtual_deps = installed_repository.retrieveRuntimeDependencies(
                latest_kernel)
            for virtual_dep in virtual_deps:
                virtual_pkg_id, _v_rc = installed_repository.atomMatch(
                    virtual_dep)
                if virtual_pkg_id != -1:
                    installed_package_ids.add(virtual_pkg_id)
        else:
            # Old virtual package detected (pre EAPI=7). Assume it's a kernel
            # binary.
            installed_package_ids.add(latest_kernel)

        return installed_package_ids
Exemplo n.º 5
0
    def _get_installed_kernels(self, installed_repository):
        """
        Return a set of kernel packages that are installed on the system.
        """
        installed_package_ids = set()
        # Resolve the target kernel using the installed packages repository.
        # First, locate the virtual kernel package (if new virtuals are in
        # use.)
        latest_kernel, _k_rc = installed_repository.atomMatch(KERNEL_BINARY_VIRTUAL)
        if latest_kernel == -1:
            # Virtual package is not installed.
            # This happens when kernel packages have been moved to the new
            # virtual and PROVIDE is broken or no longer supported (EAPI=7?).
            print_warning("%s: %s %s" % (
                red(_("Attention")),
                KERNEL_BINARY_VIRTUAL,
                brown(_("is not installed. Unable to resolve kernel "
                        "packages correctly. Please use --from-running or install"
                        "the package. Is your system up-to-date?"))))
            return installed_package_ids

        # If we have resolved the package to the virtual, we need to go
        # one level deep and retrieve the list of available kernel packages.
        # Do not assume that we hit only one kernel package when scanning, we
        # may have different packages in the dependency list.
        virtual_key = entropy.dep.dep_getkey(KERNEL_BINARY_VIRTUAL)
        latest_key_slot = installed_repository.retrieveKeySlot(latest_kernel)
        if latest_key_slot:
            latest_key, _unused = latest_key_slot
        else:
            # Cannot find installed package, give up.
            print_warning("%s: %s" % (
                red(_("Attention")),
                brown(_("Unable to resolve the latest kernel metadata. Try again later."))
            ))
            return installed_package_ids

        if virtual_key == latest_key:
            print_info("%s: %s" % (
                red(_("Resolving virtual kernel package")),
                KERNEL_BINARY_VIRTUAL,
            ))
            # New virtual package support.
            virtual_deps = installed_repository.retrieveRuntimeDependencies(
                latest_kernel)
            for virtual_dep in virtual_deps:
                virtual_pkg_id, _v_rc = installed_repository.atomMatch(virtual_dep)
                if virtual_pkg_id != -1:
                    installed_package_ids.add(virtual_pkg_id)
        else:
            # Old virtual package detected (pre EAPI=7). Assume it's a kernel
            # binary.
            installed_package_ids.add(latest_kernel)

        return installed_package_ids
Exemplo n.º 6
0
def _show_kernel_warnings(kernel_atom):
    print_info("%s %s" % (purple(kernel_atom), teal(_("has been installed."))))
    print_warning("%s: %s" % (red(_("Attention")),
        brown(_("some external drivers cannot work across multiple kernels."))))
    print_warning(darkgreen(_("Please reboot your computer now !")))