summaryrefslogtreecommitdiff
path: root/tests/old/pkgsrcrecords.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-03-23 14:18:44 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-03-23 14:18:44 +0100
commit37650a078f5504dfbc6622d2c06f4435a3302dd4 (patch)
tree35d7df75535420cbe0712a5f7b7b66d61f5e44d1 /tests/old/pkgsrcrecords.py
parent2aa709e41d8896ef897863ea9181c409c4c87a8c (diff)
parent3a08cfb10590d5cf5df1f45d94a424ef6a0f674b (diff)
downloadpython-apt-37650a078f5504dfbc6622d2c06f4435a3302dd4.tar.gz
merged from lp:~mvo/python-apt/mvo
Diffstat (limited to 'tests/old/pkgsrcrecords.py')
-rw-r--r--tests/old/pkgsrcrecords.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/old/pkgsrcrecords.py b/tests/old/pkgsrcrecords.py
new file mode 100644
index 00000000..2ea9dd3a
--- /dev/null
+++ b/tests/old/pkgsrcrecords.py
@@ -0,0 +1,29 @@
+#!/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.PackageCount,
+ (float(i) / float(cache.PackageCount) * 100)),
+
+
+if __name__ == "__main__":
+ main()
+ sys.exit(0)