Bug 70791 - rpm api change breaks c++ programs using it
rpm api change breaks c++ programs using it
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2002-08-05 07:18 EDT by Daniel Resare
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-08-05 09:56:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
simplest possible test-case (141 bytes, text/plain)
2002-08-05 08:57 EDT, Daniel Resare
no flags Details

  None (edit)
Description Daniel Resare 2002-08-05 07:18:09 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
(file:///usr/share/doc/rpm-devel-4.1/apidocs/html/upgrade_8c-source.html) .
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
Comment 1 Daniel Resare 2002-08-05 08:57:39 EDT
Created attachment 68886 [details]
simplest possible test-case
Comment 2 Daniel Resare 2002-08-05 09:00:56 EDT
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)'
Comment 3 Jeff Johnson 2002-08-05 09:22:21 EDT
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.
Comment 4 Daniel Resare 2002-08-05 09:55:55 EDT
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.

Comment 5 Jeff Johnson 2002-11-18 10:48:57 EST
Apt appears to compile with rpm-4.1 now.

Note You need to log in before you can comment on or make changes to this bug.