fix: --rollback PSM_INIT changes added fstates before initialize. http://rpm5.org/cvs/chngview?cn=9486 --- rpm-4.4.9/lib/psm.c 2008-02-05 19:50:14.238918269 +0200 +++ rpm-4.4.9-cs9486/lib/psm.c 2008-02-05 19:47:16.644011486 +0200 @@ -1497,10 +1497,6 @@ int xx = 1; assert(fi->h != NULL); - if (fi->fstates != NULL && fc > 0) - xx = headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, - fi->fstates, fc); -assert(xx); xx = headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, &installTime, 1); @@ -1530,6 +1526,28 @@ return 0; } + +/** + * Add fi->states to an install header. + * @param ts transaction set + * @param te transaction element + * @param fi file info set + * @return 0 always + */ +static int postPopulateInstallHeader(const rpmts ts, const rpmte te, rpmfi fi) + /*@modifies fi @*/ +{ + HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int fc = rpmfiFC(fi); + int xx = 1; + + if (fi->fstates != NULL && fc > 0) { + xx = headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fi->fstates, fc); + } + + return 0; +} + static void * rpmpsmThread(void * arg) /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies arg, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -2059,6 +2081,9 @@ if (rc) break; } + /* Add fi->fstates to install header. */ + xx = postPopulateInstallHeader(ts, psm->te, fi); + rc = rpmpsmNext(psm, PSM_RPMDB_ADD); if (rc) break; --- rpm-4.4.9/lib/transaction.c 2007-05-17 01:47:00.000000000 +0300 +++ rpm-4.4.9-cs9486/lib/transaction.c 2008-02-05 19:39:52.565758407 +0200 @@ -895,9 +895,6 @@ /*@-dependenttrans@*/ if (netsharedPaths) freeSplitString(netsharedPaths); -#ifdef DYING /* XXX freeFi will deal with this later. */ - fi->flangs = _free(fi->flangs); -#endif if (languages) freeSplitString((char **)languages); /*@=dependenttrans@*/ }