File: pkgsrcrecords.py

package info (click to toggle)
python-apt 2.6.0
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,044 kB
  • sloc: cpp: 10,192; python: 8,547; makefile: 94; sh: 18
file content (30 lines) | stat: -rw-r--r-- 619 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python2.4
#
# Test for the PkgSrcRecords code
# it segfaults for python-apt < 0.5.37
#

import apt_pkg
import sys


def main():
    apt_pkg.init()
    cache = apt_pkg.Cache()
    i = 0
    print("Running PkgSrcRecords test on all packages:")
    for x in cache.packages:
        i += 1
        src = apt_pkg.SourceRecords()
        if src.lookup(x.name):
            # print src.package
            pass
        print(
            "\r%i/%i=%.3f%%    "
            % (i, cache.package_count, (float(i) / float(cache.package_count) * 100))
        )


if __name__ == "__main__":
    main()
    sys.exit(0)