From: Panu Matilainen Date: Wed, 18 Jun 2008 09:57:36 +0000 (+0300) Subject: Convert rpmpsmStage() to use headerPut() X-Git-Tag: rpm-4.6.0-rc1~299 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=005c5663e3f9eac1c6af835dcec7d8074783be31;p=platform%2Fupstream%2Frpm.git Convert rpmpsmStage() to use headerPut() --- diff --git a/lib/psm.c b/lib/psm.c index f7f7a9f..a6a4383 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -1497,19 +1497,20 @@ assert(psm->mi == NULL); if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; if (psm->goal == PSM_PKGINSTALL) { + struct rpmtd_s td; rpm_time_t installTime = (rpm_time_t) time(NULL); rpm_count_t fc = rpmfiFC(fi); if (fi->h == NULL) break; /* XXX can't happen */ - if (fi->fstates != NULL && fc > 0) - xx = headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, - fi->fstates, fc); - - xx = headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, - &installTime, 1); + if (fi->fstates != NULL && fc > 0) { + if (rpmtdFromUint8(&td, RPMTAG_FILESTATES, fi->fstates, fc)) + headerPut(fi->h, &td, HEADERPUT_DEFAULT); + } - xx = headerAddEntry(fi->h, RPMTAG_INSTALLCOLOR, RPM_INT32_TYPE, - &tscolor, 1); + if (rpmtdFromUint32(&td, RPMTAG_INSTALLTIME, &installTime, 1)) + headerPut(fi->h, &td, HEADERPUT_DEFAULT); + if (rpmtdFromUint32(&td, RPMTAG_INSTALLCOLOR, &tscolor, 1)) + headerPut(fi->h, &td, HEADERPUT_DEFAULT); /* * If this package has already been installed, remove it from