public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Daniel Pielmeier" <daniel.pielmeier@googlemail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: Question about difference between emerge --update world and emerge vigra
Date: Thu, 25 Sep 2008 17:51:58 +0200	[thread overview]
Message-ID: <6142e6140809250851r45d271b2y600fcddd64cd2550@mail.gmail.com> (raw)
In-Reply-To: <loom.20080925T150240-160@post.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

2008/9/25 James <wireless@tampabay.rr.com>:

> Do you have any further advice, more detail or some more formalized methodology
> to 'clean' the world file, in addition to what you have stated above?
>

Every entry in the world file that has a reverse dependency could be
removed. Unfortunately there is no tool I know which can calculate
reverse dependencies correctly. Maybe there is some functionality in
pkgcore or paludis which I am not aware of. So others need to inform
us about this.

However, this question has already been raised and Alber Hopkins
attached a python script in an earlier thread which should show
unneeded entries in the world file. It did not work for me but I have
attached it, maybe you have more luck than I.

The solution I use is app-portage/udept. It is not maintained anymore
so I recommend to use the ebuild from this bug [1] which at least has
a few advantages over the ebuild in the tree. Udept used to be a
powerful script but a few functions do not work properly anymore. The
option for cleaning the world file works reliable though. Just invoke
it with "dep -w"

[1] http://bugs.gentoo.org/show_bug.cgi?id=172611

Regards,

Daniel

[-- Attachment #2: auditworld --]
[-- Type: text/plain, Size: 1875 bytes --]

#!/usr/bin/python
"""
Report any packages in world which have direct dependencies also in world
"""

__version__ = (0,3,0)

import os
import sys
sys.path.insert(0, '/usr/lib/gentoolkit/pym')
os.environ['PORTAGE_CALLER'] = 'repoman'

import portage
TREE = portage.db["/"]["vartree"]

import gentoolkit


def get_versions_installed(pkg):
    """
    Return a list containt versions of pkg installed (in cpv format)
    may be an empty list.
    """
    return TREE.dbapi.match(pkg)


def get_world():
    """Return a list of all packages in world"""
    _file = sys.stdin
    _list = [line.strip() for line in _file]
    return _list

def get_deps(pkg):
    """Return a list of all packages depending on pkg (directly)"""
    deps = set()
    for cpv in get_versions_installed(pkg):
        gentoolkit_pkg = gentoolkit.Package(cpv)
        rdeps = [i[2] for i in gentoolkit_pkg.get_runtime_deps() if not
                i[2].startswith('virtual/')]
        for rdep in rdeps:
            split = portage.pkgsplit(rdep)
            if split is not None:
                deps.add(split[0])
            else:
                deps.add(rdep)

        pdeps = [i[2] for i in gentoolkit_pkg.get_postmerge_deps() if not
                i[2].startswith('virtual/')]
        for pdep in pdeps:
            split = portage.pkgsplit(pdep)
            if split is not None:
                deps.add(split[0])
            else:
                deps.add(pdep)
        #print deps
    #command= '/usr/bin/equery -q -C d %s' % pkg
    #pipe = os.popen(command, 'r')
    #_list = [portage.pkgsplit(line.strip())[0] for line in pipe]
    return deps

if __name__ == '__main__':
    world = get_world()
    for pkg in world:
        deps = get_deps(pkg)
        for dep in deps:
            if (dep != pkg) and (dep in world):
                print '%(pkg)s already depends on %(dep)s' % locals()

  parent reply	other threads:[~2008-09-25 15:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-25  4:05 [gentoo-user] Question about difference between emerge --update world and emerge vigra SOrCErEr
2008-09-25  5:13 ` Thomas Kahle
2008-09-25  6:16   ` Volker Armin Hemmann
2008-09-25  5:24 ` Marc Joliet
2008-09-25  6:24 ` Alan McKinnon
2008-09-25  9:54   ` SOrCErEr
2008-09-25 10:12     ` Vladimir Rusinov
2008-09-25 10:26       ` Alan McKinnon
2008-09-26  3:56         ` SOrCErEr
2008-09-25 10:23     ` Neil Bothwick
2008-09-25 10:27 ` Daniel Pielmeier
2008-09-25 15:08   ` [gentoo-user] " James
2008-09-25 15:29     ` Neil Bothwick
2008-09-25 15:51     ` Daniel Pielmeier [this message]
2008-09-25 18:32       ` James
2008-09-29 20:33         ` Daniel Pielmeier
2008-09-30 11:28           ` Paul Stear
2008-09-30 12:32             ` Daniel Pielmeier
2008-09-25 20:15       ` Alan McKinnon
2008-09-25 20:55         ` Paul Hartman
2008-09-25 21:43           ` Neil Bothwick
2008-09-25 21:59             ` Alan McKinnon
2008-09-25 22:53               ` Neil Bothwick
2008-09-25 15:51   ` [gentoo-user] " Hilco Wijbenga
2008-09-25 20:38     ` Alan McKinnon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6142e6140809250851r45d271b2y600fcddd64cd2550@mail.gmail.com \
    --to=daniel.pielmeier@googlemail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox