[Apt-Rpm] Compilation issues with 0.5.15lorg3.94a (rpmpm.cc)

Per Øyvind Karlsen pkarlsen at mandriva.com
Thu Mar 6 11:38:06 PST 2008


På Torsdag 06 mars 2008 , 19:55:41 skrev Vincent Danen:
> * [2008-03-06 18:42:40 +0100] Per ?yvind Karlsen wrote:
> >På Torsdag 06 mars 2008 , 16:59:37 skrev Vincent Danen:
> >>   g++ -DHAVE_CONFIG_H -I. -I../include -I../include/apt-pkg
> >> -DLIBDIR=\"/usr/lib\" -DPKGDATADIR=\"/usr/share/apt\"
> >> -DLOCALEDIR=\"/usr/share/locale\" -DAPT_DOMAIN=\"apt\" -I../lua/include
> >> -I../lua/local -I/usr/include/libxml2 -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2
> >> -fstack-protector --param=ssp-buffer-size=4 -fexceptions
> >> -fomit-frame-pointer -march=i586 -mtune=generic
> >> -fasynchronous-unwind-tables -MT rpm/rpmpm.lo -MD -MP -MF
> >> rpm/.deps/rpmpm.Tpo -c rpm/rpmpm.cc  -fPIC -DPIC -o rpm/.libs/rpmpm.o
> >> rpm/rpmpm.cc: In member function 'virtual bool
> >> pkgRPMLibPM::Process(std::vector<const char*, std::allocator<const
> >> char*>
> >>
> >> >&, std::vector<const char*, std::allocator<const char*> >&,
> >>
> >> std::vector<const char*, std::allocator<const char*> >&)':
> >> rpm/rpmpm.cc:907: error: invalid conversion from 'void* (*)(const void*,
> >> rpmCallbackType, rpmCallbackSize_t, rpmCallbackSize_t, const void*,
> >> void*)' to 'void* (*)(const void*, rpmCallbackType, long long unsigned
> >> int, long long unsigned int, const void*, void*)' rpm/rpmpm.cc:907:
> >> error: initializing argument 2 of 'int rpmtsSetNotifyCallback(rpmts_s*,
> >> void* (*)(const void*, rpmCallbackType, long long unsigned int, long
> >> long unsigned int, const void*, void*), void*)' make[1]: ***
> >> [rpm/rpmpm.lo] Error 1
> >> make[1]: *** Waiting for unfinished jobs....
> >> make[1]: Leaving directory
> >> `/home/vdanen/svn/3.1-CURRENT/apt/BUILD/apt-0.5.15lorg3.94a/apt-pkg'
> >> make: *** [all-recursive] Error 1
> >> error: Bad exit status from /home/vdanen/tmp/rpm-tmp.67969 (%build)
> >
> >Wild guess without knowing what rpm version you have or how code for apt
> >0.5.15lorg3.94a(neat versioning!) looks like, but I would think that
> > you'll find something like 'typedef unsigned long rpmCallbackSize_t' in
> >aptcallback.h or wherever it might reside, make it 'typedef unsigned long
> >long rpmCallbackSize_t'.
>
> Ok, I see it in apt-pkg/rpm/aptcallback.h:
>
> #if HAVE_RPM_RPMCB_H
> typedef unsigned long long rpmCallbackSize_t;
> #else
> typedef unsigned long rpmCallbackSize_t;
> #endif
>
> and in include/config.h:
>
> /* Define to 1 if you have the <rpm/rpmcb.h> header file. */
> /* #undef HAVE_RPM_RPMCB_H */
>
> Just looked, and I don't have rpm/rpmcb.h (using rpm 4.4.5).
>
> The following patch fixes the compilation for me, but not sure if this
> would be the correct way to do it:
>
> --- apt-pkg/rpm/aptcallback.h~  2008-03-06 11:51:09.113968991 -0700
> +++ apt-pkg/rpm/aptcallback.h   2008-03-06 11:51:09.113968991 -0700
> @@ -4,11 +4,7 @@
>   #include <apt-pkg/progress.h>
>   #include <rpm/rpmcli.h>
>
> -#if HAVE_RPM_RPMCB_H
>   typedef unsigned long long rpmCallbackSize_t;
> -#else
> -typedef unsigned long rpmCallbackSize_t;
> -#endif
>
>   #if RPM_VERSION < 0x040000
>   void * rpmCallback(const Header h,
>
> Thanks for the hints, Per!  =)

I guess there's been some (obviously?) false assumption on that rpmcb.h showed 
up at the same time of the change to 'unsigned long long' which AFAIK took 
place in rpm 4.4.5. So the more correct patch would probably be the following 
(with my rpm 5.0 adaption as well):

--- a/apt-pkg/rpm/aptcallback.h
+++ b/apt-pkg/rpm/aptcallback.h
@@ -4,7 +4,9 @@
 #include <apt-pkg/progress.h>
 #include <rpm/rpmcli.h>

-#if HAVE_RPM_RPMCB_H
+#if RPM_VERSION >= 0x050000
+typedef uint64_t rpmCallbackSize_t;
+#elif RPM_VERSION >= 0x040405
 typedef unsigned long long rpmCallbackSize_t;
 #else
 typedef unsigned long rpmCallbackSize_t;

-- 
Regards,
Per Øyvind Karlsen
Mandriva Norway



More information about the Apt-Rpm mailing list