diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-02-04 15:55:16 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-02-04 15:55:16 +0200 |
commit | 4e4aec28c544f2884cb76be37d508f376db5cb7c (patch) | |
tree | 8fbd80142d4f15b7de1a28c6b8c114254b1fcb01 /lib | |
parent | 251deaeeb7c0c679a33b17527eaee27369a38cdb (diff) | |
download | librpm-tizen-4e4aec28c544f2884cb76be37d508f376db5cb7c.tar.gz librpm-tizen-4e4aec28c544f2884cb76be37d508f376db5cb7c.tar.bz2 librpm-tizen-4e4aec28c544f2884cb76be37d508f376db5cb7c.zip |
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)
Diffstat (limited to 'lib')
-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 d913258bd..7d12eebf2 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -219,6 +219,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) @@ -238,7 +242,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, @@ -248,7 +252,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, |