summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/psm.c7
-rw-r--r--lib/rpmfi.c8
2 files changed, 6 insertions, 9 deletions
diff --git a/lib/psm.c b/lib/psm.c
index abf3b5da3..3b7437968 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -1276,12 +1276,6 @@ assert(psm->mi == NULL);
psm->mi = rpmdbFreeIterator(psm->mi);
rc = RPMRC_OK;
- /* XXX lazy alloc here may need to be done elsewhere. */
- if (fi->fstates == NULL && fc > 0) {
- fi->fstates = xmalloc(sizeof(*fi->fstates) * fc);
- memset(fi->fstates, RPMFILE_STATE_NORMAL, fc);
- }
-
if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) break;
if (fc <= 0) break;
@@ -1591,7 +1585,6 @@ assert(psm->mi == NULL);
psm->failedFile = _free(psm->failedFile);
fi->apath = _free(fi->apath);
- fi->fstates = _free(fi->fstates);
break;
case PSM_PKGINSTALL:
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
index a2803b5e9..26159f79e 100644
--- a/lib/rpmfi.c
+++ b/lib/rpmfi.c
@@ -1266,9 +1266,13 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags)
_hgfi(h, RPMTAG_FILEDEPENDSN, &td, scareFlags, fi->fddictn);
}
+ /* XXX States not needed by TR_REMOVED */
_hgfi(h, RPMTAG_FILESTATES, &td, defFlags, fi->fstates);
- if (fi->fstates == NULL)
- fi->fstates = xcalloc(fi->fc, sizeof(*fi->fstates));
+ if (fi->fstates == NULL) {
+ fi->fstates = xmalloc(sizeof(*fi->fstates) * fi->fc);
+ /* XXX means we show state "normal" when package not even installed */
+ memset(fi->fstates, RPMFILE_STATE_NORMAL, fi->fc);
+ }
_hgfi(h, RPMTAG_FILECAPS, &td, defFlags, fi->fcaps);