From c7e5bc027ba3ca22a60f3d2e4d2ec2523122c15a Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 14 Dec 2011 19:37:06 +0000 Subject: (Spec_binrpm) implement it for rpm-4.9.x git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@161 971eb68f-4bfb-0310-8326-d2484c010a4c --- RPM4/src/RPM4.xs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index 88da434..bf0e8a3 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -2810,7 +2810,8 @@ Spec_binrpm(spec) Header header; PPCODE: #ifdef RPM4_9_0 - croak("binrpm is no more supported with rpm 4.9; FIXME"); + rpmSpecPkgIter iter = rpmSpecPkgIterInit(spec); + while ((pkg = rpmSpecSrcIterNext(iter)) != NULL) { #else for(pkg = spec->packages; pkg != NULL; pkg = pkg->next) { if (pkg->fileList == NULL) @@ -2818,7 +2819,11 @@ Spec_binrpm(spec) #endif /* headerCopyTags(h, pkg->header, copyTags); */ binFormat = rpmGetPath("%{_rpmfilename}", NULL); +#ifdef RPM4_9_0 + header = rpmSpecSourceHeader(spec); +#else header = pkg->header; +#endif binRpm = headerFormat(header, binFormat, NULL); free(binFormat); path = rpmGetPath("%{_rpmdir}/", binRpm, NULL); -- cgit v1.2.1