File: test_enhances.py

package info (click to toggle)
python-apt 0.7.100.1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,748 kB
  • ctags: 1,919
  • sloc: cpp: 8,937; python: 5,750; makefile: 89; sh: 9
file content (17 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/python

import apt

cache = apt.Cache()

for pkg in cache:
    if pkg.installed and pkg.installed.enhances:
        s = "%s enhances:" % pkg.name
        for or_list in pkg.installed.enhances:
            for enhances in or_list.or_dependencies:
                s += " %s" % enhances.name
                if (cache.has_key(enhances.name) and
                    not cache[enhances.name].isInstalled):
                    s += "(*missing*) "
                s += ","
            print s[:-1]