blob: af19434aedf23cc9ce8c6bfc8af3a8425baeb830 (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#!/usr/bin/python
import rpm
import sys
import gtk
from _gtk import gtk_set_locale
gtk_set_locale ()
import time
#time.sleep(10)
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('kernel')
h = db[rc[0]]
rpm.addMacro("_i18ndomains", "redhat-dist");
print h['summary']
print h['description']
print h['group']
print h['version']
print h['release']
#print h['filenames']
print h[rpm.RPMTAG_SUMMARY]
print h[rpm.RPMTAG_DESCRIPTION]
print h[rpm.RPMTAG_GROUP]
#print h[rpm.RPMTAG_FILENAMES]
sys.exit(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')
|