RPM Community Forums

Mailing List Message of <rpm-users>

rpm dependency checking via python

From: юрка олейников <yurkao@gmail.com>
Date: Sat 08 May 2010 - 15:15:13 CEST
Message-ID: <AANLkTinnMsdew-VylfhELSmbZAjXb4pIUF6neu0b04Gf@mail.gmail.com>
how do i check in python if rpmA has satisfied dependecies from rpmB if i do
not want to use rpmdb?

i thought that i can check 'provides' vs 'requires' fields of rpm header
read from rpm-file.
but looking on bash.rpm from CentOS 5 i've been a little bit confused:

>>> import rpm
>>> file = open("rpms/bash.rpm")
>>> header = ts.hdrFromFdno(file.fileno())
>>> header['requires']
['/bin/bash', '/bin/sh', '/bin/sh', '/bin/sh', 'config(bash)', 'libc.so.6',
'libc.so.6(GLIBC_2.0)', 'libc.so.6(GLIBC_2.1)', 'libc.so.6(GLIBC_2.2)',
'libc.so.6(GLIBC_2.3)', 'libc.so.6(GLIBC_2.3.4)', 'libc.so.6(GLIBC_2.4)',
'libdl.so.2', 'libdl.so.2(GLIBC_2.0)', 'libdl.so.2(GLIBC_2.1)',
'libtermcap.so.2', 'mktemp', 'rpmlib(CompressedFileNames)',
'rpmlib(PayloadFilesHavePrefix)', 'rtld(GNU_HASH)']
>>> header['provides']
['config(bash)', 'bash']

>>> header.dsOfHeader()
P bash = 3.2-21.el5

>>> header.dsFromHeader()
R /bin/bash
R /bin/sh
R /bin/sh
R /bin/sh
R config(bash) = 3.2-21.el5
R libc.so.6
R libc.so.6(GLIBC_2.0)
R libc.so.6(GLIBC_2.1)
R libc.so.6(GLIBC_2.2)
R libc.so.6(GLIBC_2.3)
R libc.so.6(GLIBC_2.3.4)
R libc.so.6(GLIBC_2.4)
R libdl.so.2
R libdl.so.2(GLIBC_2.0)
R libdl.so.2(GLIBC_2.1)
R libtermcap.so.2
R mktemp
R rpmlib(CompressedFileNames) <= 3.0.4-1
R rpmlib(PayloadFilesHavePrefix) <= 4.0-1
R rtld(GNU_HASH)

e.g.* bash depends on itself* :
R /bin/bash
R /bin/sh
R /bin/sh
R /bin/sh
R config(bash) = 3.2-21.el5

moreover, who provides the flowing? :
R rpmlib(CompressedFileNames) <= 3.0.4-1
R rpmlib(PayloadFilesHavePrefix) <= 4.0-1

so my question is: what is the proper way to verify rpm dependencies without
rpmdb (using only rpm files)?
sure i've missed something...
thanks

-- 
Be Secure, Stay Open - live w/ OpenBSD
Received on Sat May 8 15:22:43 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.