GRAYBYTE WORDPRESS FILE MANAGER5820

Server IP : 149.255.58.128 / Your IP : 216.73.216.23
System : Linux cloud516.thundercloud.uk 5.14.0-427.26.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 17 15:51:13 EDT 2024 x86_64
PHP Version : 8.2.28
Disable Function : allow_url_include, apache_child_terminate, apache_setenv, exec, passthru, pcntl_exec, posix_kill, posix_mkfifo, posix_getpwuid, posix_setpgid, posix_setsid, posix_setuid, posix_setgid, posix_seteuid, posix_setegid, posix_uname, proc_close, proc_get_status, proc_open, proc_terminate, shell_exec, show_source, system
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /usr/lib/python3.9/site-packages/dnf-plugins/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/lib/python3.9/site-packages/dnf-plugins//repograph.py
# repograph.py
# DNF plugin adding a command to Output a full package dependency graph in dot
# format.
#
# Copyright (C) 2015 Igor Gnatenko
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.  You should have received a copy of the
# GNU General Public License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
# source code or documentation are not subject to the GNU General Public
# License and may only be used or replicated with the express permission of
# Red Hat, Inc.
#

from __future__ import absolute_import
from __future__ import unicode_literals
from dnfpluginscore import _, logger

import dnf.cli

DOT_HEADER = """
size="20.69,25.52";
ratio="fill";
rankdir="TB";
orientation=port;
node[style="filled"];
"""


class RepoGraph(dnf.Plugin):

    name = "repograph"

    def __init__(self, base, cli):
        super(RepoGraph, self).__init__(base, cli)
        if cli is None:
            return
        cli.register_command(RepoGraphCommand)


class RepoGraphCommand(dnf.cli.Command):
    aliases = ("repograph", "repo-graph",)
    summary = _("Output a full package dependency graph in dot format")

    def configure(self):
        demands = self.cli.demands
        demands.sack_activation = True
        demands.available_repos = True
        if self.opts.repo:
            for repo in self.base.repos.all():
                if repo.id not in self.opts.repo:
                    repo.disable()
                else:
                    repo.enable()

    def run(self):
        self.do_dot(DOT_HEADER)

    def do_dot(self, header):
        maxdeps = 0
        deps = self._get_deps(self.base.sack)

        print("digraph packages {")
        print("{}".format(header))

        for pkg in deps.keys():
            if len(deps[pkg]) > maxdeps:
                maxdeps = len(deps[pkg])

            # color calculations lifted from rpmgraph
            h = 0.5 + (0.6 / 23 * len(deps[pkg]))
            s = h + 0.1
            b = 1.0

            print('"{}" [color="{:.12g} {:.12g} {}"];'.format(pkg, h, s, b))
            print('"{}" -> {{'.format(pkg))
            for req in deps[pkg]:
                print('"{}"'.format(req))
            print('}} [color="{:.12g} {:.12g} {}"];\n'.format(h, s, b))
        print("}")

    @staticmethod
    def _get_deps(sack):
        requires = {}
        prov = {}
        skip = []

        available = sack.query().available()
        for pkg in available:
            xx = {}
            for req in pkg.requires:
                reqname = str(req)
                if reqname in skip:
                    continue
                # XXX: https://bugzilla.redhat.com/show_bug.cgi?id=1186721
                if reqname.startswith("solvable:"):
                    continue
                if reqname in prov:
                    provider = prov[reqname]
                else:
                    provider = available.filter(provides=reqname)
                    if not provider:
                        logger.debug(_("Nothing provides: '%s'"), reqname)
                        skip.append(reqname)
                        continue
                    else:
                        provider = provider[0].name
                    prov[reqname] = provider
                if provider == pkg.name:
                    xx[provider] = None
                if provider in xx or provider in skip:
                    continue
                else:
                    xx[provider] = None
                requires[pkg.name] = xx.keys()
        return requires

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 19 2025 22:42:16
0 / root
0755
__pycache__
--
May 14 2025 21:42:23
0 / root
0755
builddep.py
9.127 KB
September 09 2022 11:42:50
0 / root
0644
changelog.py
4.851 KB
September 09 2022 11:42:50
0 / root
0644
config_manager.py
10.63 KB
September 09 2022 11:42:50
0 / root
0644
copr.py
29.588 KB
September 09 2022 11:42:50
0 / root
0644
debug.py
12.264 KB
September 09 2022 11:42:50
0 / root
0644
debuginfo-install.py
10.824 KB
September 09 2022 11:42:50
0 / root
0644
download.py
12.041 KB
September 09 2022 11:42:50
0 / root
0644
generate_completion_cache.py
3.855 KB
September 09 2022 11:42:50
0 / root
0644
groups_manager.py
13.215 KB
September 09 2022 11:42:50
0 / root
0644
kpatch.py
8.123 KB
April 05 2023 20:40:53
0 / root
0644
needs_restarting.py
10.987 KB
October 02 2024 13:18:37
0 / root
0644
repoclosure.py
6.887 KB
September 09 2022 11:42:50
0 / root
0644
repodiff.py
11.206 KB
September 09 2022 11:42:50
0 / root
0644
repograph.py
3.996 KB
September 09 2022 11:42:50
0 / root
0644
repomanage.py
10.322 KB
September 09 2022 11:42:50
0 / root
0644
reposync.py
14.305 KB
September 09 2022 11:42:50
0 / root
0644
spacewalk.py
13.876 KB
February 26 2025 09:32:58
0 / root
0644
system_upgrade.py
26.876 KB
October 02 2024 13:18:37
0 / root
0644
universal_hooks.py
5.778 KB
May 06 2025 19:28:09
0 / root
0755

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF