Account for temporary disk-space requirement on forced replace too

- Similar to commit 85df102165, but
  for forced file replacements.
This commit is contained in:
Panu Matilainen 2012-11-14 12:19:49 +02:00
parent f8da4f6136
commit b1d3f21a54
1 changed files with 5 additions and 3 deletions

View File

@ -212,6 +212,11 @@ static void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName,
dsi->bdelta += BLOCK_ROUND(prevSize, dsi->bsize); dsi->bdelta += BLOCK_ROUND(prevSize, dsi->bsize);
dsi->idelta++; dsi->idelta++;
} }
if (fixupSize) {
dsi->bdelta += BLOCK_ROUND(fixupSize, dsi->bsize);
dsi->idelta++;
}
break; break;
case FA_ERASE: case FA_ERASE:
@ -223,9 +228,6 @@ static void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName,
break; break;
} }
if (fixupSize)
dsi->bneeded -= BLOCK_ROUND(fixupSize, dsi->bsize);
/* adjust bookkeeping when requirements shrink */ /* adjust bookkeeping when requirements shrink */
if (dsi->bneeded < dsi->obneeded) dsi->obneeded = dsi->bneeded; if (dsi->bneeded < dsi->obneeded) dsi->obneeded = dsi->bneeded;
if (dsi->ineeded < dsi->oineeded) dsi->oineeded = dsi->ineeded; if (dsi->ineeded < dsi->oineeded) dsi->oineeded = dsi->ineeded;