summaryrefslogtreecommitdiff
path: root/python/testit
blob: fc5e787929d37b6e03a6db585447ae52019d5473 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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.findpackage ("Xconfigurator")
for rec in rc:
    print db[rec]
    print db[rec]['name']