summaryrefslogtreecommitdiff
path: root/python/testhdr
blob: f1b8150b5fc33206f6cdcb2656ef36934935b9c4 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/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')

print "-------------- expand --------------------"
h.expandFilelist()
printlist (h, 'oldfilenames')
printlist (h, 'filenames')

print "-------------- compress --------------------"
h.compressFilelist()
printlist (h, 'oldfilenames')
printlist (h, 'filenames')

print "-------------- expand --------------------"
h.expandFilelist()
printlist (h, 'oldfilenames')
printlist (h, 'filenames')

print "-------------- full --------------------"
h.fullFilelist()
printlist (h, 'oldfilenames')
printlist (h, 'filenames')