diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-02-04 15:55:16 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-06-11 10:05:04 +0300 |
commit | 51f8e2e71b0845fd6fa211fb05aa9191162a7f0a (patch) | |
tree | 2c255a6541f5b377703bd5dd226f724508784be9 | |
parent | 7734fb25ce7c6cb32961a8f980925f9c6e159c4d (diff) | |
download | rpm-51f8e2e71b0845fd6fa211fb05aa9191162a7f0a.tar.gz |
Handle erased packages wrt disk-space problem reporting (RhBug:561160)
- erased packages in the transaction cause space needs to shrink, which
commit 2222e81e1cf74bbf78acb9969592ab06e2289929 failed to take into
account, causing false disk space errors from unaffected packages
- adjust obneeded and oineeded when the requirements shrink
- new disk space problems can only occur when the requirements grow,
change the pmtsCheckDSIProblems() check to reflect that (although not
strictly necessary)
(cherry picked from commit 4e4aec28c544f2884cb76be37d508f376db5cb7c)
-rw-r--r-- | lib/transaction.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/transaction.c b/lib/transaction.c index 2a6f32150..d21040a8b 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -218,6 +218,10 @@ static void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName, if (fixupSize) dsi->bneeded -= BLOCK_ROUND(fixupSize, dsi->bsize); + + /* adjust bookkeeping when requirements shrink */ + if (dsi->bneeded < dsi->obneeded) dsi->obneeded = dsi->bneeded; + if (dsi->ineeded < dsi->oineeded) dsi->oineeded = dsi->ineeded; } static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) @@ -237,7 +241,7 @@ static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) for (; dsi->bsize; dsi++) { if (dsi->bavail >= 0 && adj_fs_blocks(dsi->bneeded) > dsi->bavail) { - if (dsi->bneeded != dsi->obneeded) { + if (dsi->bneeded > dsi->obneeded) { rpmpsAppend(ps, RPMPROB_DISKSPACE, rpmteNEVRA(te), rpmteKey(te), dsi->mntPoint, NULL, NULL, @@ -247,7 +251,7 @@ static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) } if (dsi->iavail >= 0 && adj_fs_blocks(dsi->ineeded) > dsi->iavail) { - if (dsi->ineeded != dsi->oineeded) { + if (dsi->ineeded > dsi->oineeded) { rpmpsAppend(ps, RPMPROB_DISKNODES, rpmteNEVRA(te), rpmteKey(te), dsi->mntPoint, NULL, NULL, |