summaryrefslogtreecommitdiffstats
path: root/tests/old/pkgsrcrecords.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/old/pkgsrcrecords.py')
-rw-r--r--tests/old/pkgsrcrecords.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/old/pkgsrcrecords.py b/tests/old/pkgsrcrecords.py
new file mode 100644
index 0000000..ccf791f
--- /dev/null
+++ b/tests/old/pkgsrcrecords.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python2.4
+#
+# Test for the PkgSrcRecords code
+# it segfaults for python-apt < 0.5.37
+#
+
+import sys
+
+import apt_pkg
+
+
+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)