From: Panu Matilainen Date: Wed, 11 Jan 2012 10:16:53 +0000 (+0200) Subject: Explicitly tell rpmfiNew() when its being used for build X-Git-Tag: rpm-4.10.0-beta1~149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=ef9b08a5d8964e8ec49b5f8a3ba74643c7b9e529;p=platform%2Fupstream%2Frpm.git Explicitly tell rpmfiNew() when its being used for build - Eliminate feeble heuristic on archive size tag not being set during build for detecting this and have build code explicitly pass RPMFI_ISBUILD flag instead. - Also eliminate the pointless isSource variable from rpmfiNew() while. --- diff --git a/build/files.c b/build/files.c index f222a5d..2302bb5 100644 --- a/build/files.c +++ b/build/files.c @@ -1235,6 +1235,9 @@ static void genCpioListAndHeader(FileList fl, const char *fn; char *a, **apath; + /* Used to be guess... err, determined in rpmfiNew but lets be explicit */ + flags |= RPMFI_ISBUILD; + /* rpmfiNew() only groks compressed filelists */ headerConvert(h, HEADERCONV_COMPRESSFILELIST); fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, flags); diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 6186d9f..3ff24ee 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1127,7 +1127,6 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTagVal tagN, rpmfiFlags flags) rpmfi fi = NULL; rpm_loff_t *asize = NULL; unsigned char * t; - int isBuild, isSource; struct rpmtd_s fdigests, digalgo; struct rpmtd_s td; headerGetFlags scareFlags = (flags & RPMFI_KEEPHEADER) ? @@ -1151,11 +1150,7 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTagVal tagN, rpmfiFlags flags) fi->archiveSize = asize ? *asize : 0; rpmtdFreeData(&td); - /* Archive size is not set when this gets called from build */ - isBuild = (asize == NULL); - isSource = headerIsSource(h); - if (isBuild) fi->fiflags |= RPMFI_ISBUILD; - if (isSource) fi->fiflags |= RPMFI_ISSOURCE; + if (headerIsSource(h)) fi->fiflags |= RPMFI_ISSOURCE; _hgfi(h, RPMTAG_BASENAMES, &td, defFlags, fi->bnl); fi->fc = rpmtdCount(&td);