blob: e314615a5275c43b2d425595fb6fd59c2a1048a5 (
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
|
# rpmpython.at: test rpm python bindings
# TODO: conditionalize on python availability
AT_BANNER([Python bindings])
RPMPY_CHECK([module import],[
myprint(rpm.__version__)
],
[AT_PACKAGE_VERSION]
)
RPMPY_CHECK([basic header manipulation],[
h = rpm.hdr()
h['name'] = 'testpkg'
h['version'] = '1.0'
h['release'] = '1'
h['epoch'] = 5
h['arch'] = 'noarch'
myprint(h['nevra'])
del h['epoch']
myprint(h['nevra'])
],
[testpkg-5:1.0-1.noarch
testpkg-1.0-1.noarch]
)
RPMPY_CHECK([reading a package file],[
ts = rpm.ts()
h = ts.hdrFromFdno('${RPMDATA}/RPMS/hello-1.0-1.ppc64.rpm')
myprint(h['arch'])
],
[ppc64]
)
RPMPY_CHECK([add package to transaction],[
ts = rpm.ts()
ts.addInstall('${RPMDATA}/RPMS/foo-1.0-1.noarch.rpm', 'u')
for e in ts:
myprint(e.NEVRA())
],
[foo-1.0-1.noarch]
)
|