From 0762ad3825a8adf674c5a9d13143aff233acc2c7 Mon Sep 17 00:00:00 2001 From: nanardon Date: Sat, 10 Jun 2006 20:39:49 +0000 Subject: - various other rpm 4.4.6 fix git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@102 971eb68f-4bfb-0310-8326-d2484c010a4c --- RPM4/src/RPM4.xs | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'RPM4/src') diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index 69952f6..3da7112 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -72,10 +72,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -176,10 +176,21 @@ static rpmTag sv2dbquerytag(SV * sv_tag) { /* This function replace the standard rpmShowProgress callback * during transaction to allow perl callback */ -void * transCallback(const void *h, +#ifdef RPM4_4_5 +#define RPM_CALLBACK_AMOUNT_TYPE unsigned long long +#else +#define RPM_CALLBACK_AMOUNT_TYPE unsigned long +#endif + +#ifdef RPM4_4_5 +rpmCallbackFunction +#else +void * +#endif + transCallback(const void *h, const rpmCallbackType what, - const unsigned long amount, - const unsigned long total, + const RPM_CALLBACK_AMOUNT_TYPE amount, + const RPM_CALLBACK_AMOUNT_TYPE total, const void * pkgKey, void * data) { @@ -1276,16 +1287,16 @@ Header_files(header, scaremem = O_SCAREMEM) Header header int scaremem PREINIT: - rpmfi Files; - rpmts ts = NULL; /* setting this to NULL skip path relocation + rpmfi Files = NULL; + rpmts ts = NULL; /* NULL; setting this to NULL skip path relocation * maybe a good deal is Header::Files(header, Dep = NULL) */ PPCODE: #ifdef HDLISTDEBUG PRINTF_CALL; #endif Files = rpmfiNew(ts, header, RPMTAG_BASENAMES, scaremem); - if ((Files = rpmfiInit(Files, 0)) != NULL && rpmfiNext(Files) >= 0) { - XPUSHs(sv_2mortal(sv_setref_pv(newSVpv("", 0), bless_rpmfi, Files))); + if (Files != NULL && (Files = rpmfiInit(Files, 0)) != NULL && rpmfiNext(Files) >= 0) { + XPUSHs(sv2_mortal(sv_setref_pv(newSVpv("", 0), bless_rpmfi, Files))); #ifdef HDRPMMEM PRINTF_NEW(bless_rpmfi, Files, Files->nrefs); #endif @@ -1846,7 +1857,9 @@ Ts_transrun(ts, callback, ...) (void *) ((long) INSTALL_LABEL | INSTALL_HASH | INSTALL_UPGRADE)); } else if (SvTYPE(SvRV(callback)) == SVt_PVCV) { /* ref sub */ rpmtsSetNotifyCallback(ts, - transCallback, (void *) callback); + transCallback, + (void *) + callback); } else if (SvTYPE(SvRV(callback)) == SVt_PVAV) { /* array ref */ install_flags = sv2constant(callback, "rpminstallinterfaceflags"); rpmtsSetNotifyCallback(ts, -- cgit v1.2.1