Bug 70791 - rpm api change breaks c++ programs using it
Summary: rpm api change breaks c++ programs using it
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-05 11:18 UTC by Daniel Resare
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-08-05 13:56:00 UTC
Embargoed:


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

Description Daniel Resare 2002-08-05 11:18:09 UTC
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):

rpm-devel-4.1-0.57


How Reproducible: always

Comment 1 Daniel Resare 2002-08-05 12:57:39 UTC
Created attachment 68886 [details]
simplest possible test-case

Comment 2 Daniel Resare 2002-08-05 13:00:56 UTC
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
rpm-devel-4.0.4-7x.18
[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 13:22:21 UTC
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 13:55:55 UTC
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 15:48:57 UTC
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.