Make pkg->cpioList rpmfiles instead of rpmfi

so rpmPackageFilesArchive() has only one rpmfi object.
This commit is contained in:
Panu Matilainen 2013-11-25 08:59:27 +01:00 committed by Florian Festi
parent 884b25462b
commit d39c96c0c1
5 changed files with 12 additions and 8 deletions

View File

@ -1124,10 +1124,10 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc)
/* rpmfiNew() only groks compressed filelists */ /* rpmfiNew() only groks compressed filelists */
headerConvert(h, HEADERCONV_COMPRESSFILELIST); headerConvert(h, HEADERCONV_COMPRESSFILELIST);
pkg->cpioList = rpmfiNew(NULL, h, RPMTAG_BASENAMES, pkg->cpioList = rpmfilesNew(NULL, h, RPMTAG_BASENAMES,
(RPMFI_NOFILEUSER|RPMFI_NOFILEGROUP)); (RPMFI_NOFILEUSER|RPMFI_NOFILEGROUP));
if (pkg->cpioList == NULL || rpmfiFC(pkg->cpioList) != npaths) { if (pkg->cpioList == NULL || rpmfilesFC(pkg->cpioList) != npaths) {
fl->processingFailed = 1; fl->processingFailed = 1;
} }

View File

@ -25,11 +25,12 @@
#include "debug.h" #include "debug.h"
static int rpmPackageFilesArchive(rpmfi fi, int isSrc, FD_t cfd, ARGV_t dpaths, static int rpmPackageFilesArchive(rpmfiles fi, int isSrc,
FD_t cfd, ARGV_t dpaths,
rpm_loff_t * archiveSize, char ** failedFile) rpm_loff_t * archiveSize, char ** failedFile)
{ {
int rc = 0; int rc = 0;
rpmfi archive = rpmfiNewArchiveWriter(cfd, rpmfiFiles(fi)); rpmfi archive = rpmfiNewArchiveWriter(cfd, fi);
while (!rc && (rc = rpmfiNext(archive)) >= 0) { while (!rc && (rc = rpmfiNext(archive)) >= 0) {
/* Copy file into archive. */ /* Copy file into archive. */

View File

@ -97,7 +97,7 @@ struct Package_s {
rpmds obsoletes; rpmds obsoletes;
rpmds triggers; rpmds triggers;
rpmds order; rpmds order;
rpmfi cpioList; rpmfiles cpioList;
rpm_loff_t cpioArchiveSize; rpm_loff_t cpioArchiveSize;
ARGV_t dpaths; ARGV_t dpaths;

View File

@ -16,6 +16,7 @@
#include <rpm/rpmfi.h> #include <rpm/rpmfi.h>
#include <rpm/rpmstrpool.h> #include <rpm/rpmstrpool.h>
#include "lib/rpmfi_internal.h" /* rpmfiles stuff for now */
#include "build/rpmbuild_internal.h" #include "build/rpmbuild_internal.h"
#include "debug.h" #include "debug.h"
@ -1235,7 +1236,7 @@ static rpmRC rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi f
rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg) rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg)
{ {
rpmfi fi = pkg->cpioList; rpmfi fi = rpmfilesIter(pkg->cpioList, RPMFI_ITER_FWD);
rpmfc fc = NULL; rpmfc fc = NULL;
ARGV_t av = NULL; ARGV_t av = NULL;
rpm_mode_t * fmode = NULL; rpm_mode_t * fmode = NULL;
@ -1392,6 +1393,7 @@ exit:
free(fmode); free(fmode);
rpmfcFree(fc); rpmfcFree(fc);
argvFree(av); argvFree(av);
rpmfiFree(fi);
return rc; return rc;
} }

View File

@ -13,6 +13,7 @@
#include <rpm/rpmfileutil.h> #include <rpm/rpmfileutil.h>
#include "rpmio/rpmlua.h" #include "rpmio/rpmlua.h"
#include "lib/rpmfi_internal.h" /* rpmfiles stuff */
#include "build/rpmbuild_internal.h" #include "build/rpmbuild_internal.h"
#include "debug.h" #include "debug.h"
@ -145,7 +146,7 @@ static Package freePackage(Package pkg)
pkg->fileList = argvFree(pkg->fileList); pkg->fileList = argvFree(pkg->fileList);
pkg->fileFile = argvFree(pkg->fileFile); pkg->fileFile = argvFree(pkg->fileFile);
pkg->policyList = argvFree(pkg->policyList); pkg->policyList = argvFree(pkg->policyList);
pkg->cpioList = rpmfiFree(pkg->cpioList); pkg->cpioList = rpmfilesFree(pkg->cpioList);
pkg->dpaths = argvFree(pkg->dpaths); pkg->dpaths = argvFree(pkg->dpaths);
pkg->icon = freeSources(pkg->icon); pkg->icon = freeSources(pkg->icon);