Red Hat Bugzilla – Bug 70791
rpm api change breaks c++ programs using it
Last modified: 2008-05-01 11:38:03 EDT
Description of Problem:
While trying to compile apt with the new rpm release in limbo, I found the
following breakage: apt tries to call rpmdbInitIterator with the second argument
RPMDBI_PACKAGES, as documented in the examples source python/upgrade.c
However this fails since RPMDBI_PACKAGES is defined to be an int, and the rpmTag
type (the type of the second argument of rpmdbInitIterator is now an enum.
An update to either the header-file or the example file would be nice :)
Version-Release number of selected component (if applicable):
How Reproducible: always
Created attachment 68886 [details]
simplest possible test-case
These are the results from running the attached small code-snippet on a
redhat-7.3 machine. The directory rpm-4.1/include/rpm is copied from a limbo
machine running rpm-4.1-0.57
[noa@nora slask]$ rpm -q rpm-devel
[noa@nora slask]$ g++ -I/usr/include/rpm -c rpm.cc
[noa@nora slask]$ g++ -Irpm-4.1/include/rpm -c rpm.cc
rpm.cc: In function `int main ()':
rpm.cc:8: cannot convert `int' to `rpmTag_e' for argument `2' to
`rpmdbInitIterator (rpmdb_s *, rpmTag_e, const void *, unsigned int)'
Hmmm, can you give me a real world example from
a bigger context?
For starters, you should be doing
mi = rpmtsInitIterator(ts, ...)
as an rpmdb is in the process of being removed
(i.e. made implicit/opaque) from the rpmlib API.
Please have a try at compiling http://noa.tm/slask/apt-0.3.19cnc55-fr8.src.rpm
you need compat-gcc-c++ and friends to compile it. After about 3 minutes it
fails with the above error msg.
Apt appears to compile with rpm-4.1 now.