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 */
headerConvert(h, HEADERCONV_COMPRESSFILELIST);
pkg->cpioList = rpmfiNew(NULL, h, RPMTAG_BASENAMES,
pkg->cpioList = rpmfilesNew(NULL, h, RPMTAG_BASENAMES,
(RPMFI_NOFILEUSER|RPMFI_NOFILEGROUP));
if (pkg->cpioList == NULL || rpmfiFC(pkg->cpioList) != npaths) {
if (pkg->cpioList == NULL || rpmfilesFC(pkg->cpioList) != npaths) {
fl->processingFailed = 1;
}

View File

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

View File

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

View File

@ -16,6 +16,7 @@
#include <rpm/rpmfi.h>
#include <rpm/rpmstrpool.h>
#include "lib/rpmfi_internal.h" /* rpmfiles stuff for now */
#include "build/rpmbuild_internal.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)
{
rpmfi fi = pkg->cpioList;
rpmfi fi = rpmfilesIter(pkg->cpioList, RPMFI_ITER_FWD);
rpmfc fc = NULL;
ARGV_t av = NULL;
rpm_mode_t * fmode = NULL;
@ -1392,6 +1393,7 @@ exit:
free(fmode);
rpmfcFree(fc);
argvFree(av);
rpmfiFree(fi);
return rc;
}

View File

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