diff options
author | Matt Wilson <msw@redhat.com> | 2000-02-11 20:28:49 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2000-02-11 20:28:49 +0000 |
commit | 26a78358da59fc767318cc66a765753d7148beda (patch) | |
tree | 72db4d63acdf6f2689db450edf653f8de8acd3e1 /rpmmodule | |
parent | 064abb386d69ce06d7557106263e986c3d7e868e (diff) | |
download | anaconda-26a78358da59fc767318cc66a765753d7148beda.tar.gz anaconda-26a78358da59fc767318cc66a765753d7148beda.tar.xz anaconda-26a78358da59fc767318cc66a765753d7148beda.zip |
added test program
Diffstat (limited to 'rpmmodule')
-rwxr-xr-x | rpmmodule/testhdr | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/rpmmodule/testhdr b/rpmmodule/testhdr new file mode 100755 index 000000000..d209bee38 --- /dev/null +++ b/rpmmodule/testhdr @@ -0,0 +1,31 @@ +#!/usr/bin/python + +import rpm + +def printlist(h, tag): + print "####### %s tag contains:" % tag + i = 0 + list = h[tag] + if not list: + print "NO SUCH TAG" + return + + for file in list: + print file + i = i + 1 + print "******** %d files" % i + + +db = rpm.opendb(0) +rc = db.findbyname('redhat-release') +h = db[rc[0]] +printlist (h, 'filenames') +printlist (h, 'oldfilenames') +h.expandFilelist() +print "-------------- expand --------------------" +printlist (h, 'oldfilenames') +printlist (h, 'filenames') +print "-------------- compress --------------------" +h.compressFilelist() +printlist (h, 'oldfilenames') +printlist (h, 'filenames') |