summaryrefslogtreecommitdiffstats
path: root/rpmmodule/testit
blob: 32f1394a52ca59feb790dcc87437a2c10712bf97 (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
#!/usr/bin/python

import rpm
import os

## fd = os.open('/mnt/redhat/comps/dist/6.0/i386/util-linux-2.9o-13.i386.rpm', 0)
## (hdr1, foo) = rpm.headerFromPackage (fd)
## os.close (fd)
## fd = os.open ('/mnt/redhat/comps/dist/6.1/i386/util-linux-2.9v-20.i386.rpm', 0)
## (hdr2, foo) = rpm.headerFromPackage (fd)
## os.close (fd)

## print rpm.versionCompare (hdr1, hdr1)

## print rpm.labelCompare ((None, "2.9j", "14"), (None, "2.9j", "15"))

db = rpm.opendb ()

rc = db.findbyname ("XFree86")
    
print len(rc)
for rec in rc:
    print db[rec]
    print db[rec]['name']