Re: Bug in apt 0.5.15lorg2 using rpm 4.4.5
Panu Matilainen <[email protected]> Mon, 06 Mar 2006 23:27:49 +0200
| Newsgroups | gmane.linux.conectiva.apt-rpm |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 2006-03-05 at 18:42 -0300, Herton Krzesinski wrote: > Hi, I saw that Panu is continuing work for apt-rpm, In using his new > apt a friend (Andreas Hasenack) found a bug in apt-get build-dep, > basically an apt-get build-dep <some file>.src.rpm doesn't work, it > fail on rpm internal dependencies. Looking trough the code I found the > problem and made a patch, I'm attaching it here. Here is the > description of internals about the patch: Ah.. indeed. Thanks for spotting this :) > There is an error inside new apt-rpm 0.5.15lorg2 inside the function > rpmSrcRecordParser::BuildDepends at file rpmsrcrecords.cc, as the > function was failing to detect/pass the internal rpm dependencies. > Patch details: If you want to check the results after rpmdsSearch(*, > ds) with rpmdsResult, before Search you must use the function > rpmdsSetResult (eg.: rpmdsSetResult(ds, 0)) to alloc memory for > ds->Result, otherwise rpmdsSearch will not be able to store > information in ds->Result. > > The fix could be different of course. We could avoid to use > rpmdsResult, just checking what rpmdsSearch returned (a value >=0 the > key was found, like is used just lines above with getconf for > example). Or if you consider the problem of ds->Result not being > allocated a bug of rpm, then rpmdsSingle must alloc memory for it. I > don't know if there is a right thing to do here or if the problem is > really of apt, but I decided to patch apt-rpm and this fixes the issue > of build-dep not working. I don't actually know how that piece of code even got there, the same thing is in rpmlistparser.cc in a working format.. I've fixed that for now, the "real fix" for this stuff is to stuff the dependency parsing into a single place to avoid copy-paste errors such as this, as the dependency information is handled just the same for both binary and source rpms. - Panu -