|
Panu Matilainen |
2e4024 |
commit 2222e81e1cf74bbf78acb9969592ab06e2289929
|
|
Panu Matilainen |
2e4024 |
Author: Panu Matilainen <pmatilai@redhat.com>
|
|
Panu Matilainen |
2e4024 |
Date: Tue Oct 27 10:57:35 2009 +0200
|
|
Panu Matilainen |
2e4024 |
|
|
Panu Matilainen |
2e4024 |
Make disk space problem reporting slightly saner (RhBug:517418)
|
|
Panu Matilainen |
2e4024 |
- Only report disk space/inode issues for packages that are affected
|
|
Panu Matilainen |
2e4024 |
instead of piling up all the problems in all filesystems on all remaining
|
|
Panu Matilainen |
2e4024 |
packages
|
|
Panu Matilainen |
2e4024 |
- The messages are still ambiguous at best, need to figure out something
|
|
Panu Matilainen |
2e4024 |
better one of these days...
|
|
Panu Matilainen |
2e4024 |
|
|
Panu Matilainen |
2e4024 |
diff --git a/lib/rpmts.c b/lib/rpmts.c
|
|
Panu Matilainen |
2e4024 |
index 38fedc8..6e28b82 100644
|
|
Panu Matilainen |
2e4024 |
--- a/lib/rpmts.c
|
|
Panu Matilainen |
2e4024 |
+++ b/lib/rpmts.c
|
|
Panu Matilainen |
2e4024 |
@@ -910,17 +910,23 @@ void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
|
|
Panu Matilainen |
2e4024 |
for (i = 0; i < ts->filesystemCount; i++, dsi++) {
|
|
Panu Matilainen |
2e4024 |
|
|
Panu Matilainen |
2e4024 |
if (dsi->bavail >= 0 && adj_fs_blocks(dsi->bneeded) > dsi->bavail) {
|
|
Panu Matilainen |
2e4024 |
- rpmpsAppend(ps, RPMPROB_DISKSPACE,
|
|
Panu Matilainen |
2e4024 |
+ if (dsi->bneeded != dsi->obneeded) {
|
|
Panu Matilainen |
2e4024 |
+ rpmpsAppend(ps, RPMPROB_DISKSPACE,
|
|
Panu Matilainen |
2e4024 |
rpmteNEVRA(te), rpmteKey(te),
|
|
Panu Matilainen |
2e4024 |
ts->filesystems[i], NULL, NULL,
|
|
Panu Matilainen |
2e4024 |
- (adj_fs_blocks(dsi->bneeded) - dsi->bavail) * dsi->bsize);
|
|
Panu Matilainen |
2e4024 |
+ (adj_fs_blocks(dsi->bneeded) - dsi->bavail) * dsi->bsize);
|
|
Panu Matilainen |
2e4024 |
+ dsi->obneeded = dsi->bneeded;
|
|
Panu Matilainen |
2e4024 |
+ }
|
|
Panu Matilainen |
2e4024 |
}
|
|
Panu Matilainen |
2e4024 |
|
|
Panu Matilainen |
2e4024 |
if (dsi->iavail >= 0 && adj_fs_blocks(dsi->ineeded) > dsi->iavail) {
|
|
Panu Matilainen |
2e4024 |
- rpmpsAppend(ps, RPMPROB_DISKNODES,
|
|
Panu Matilainen |
2e4024 |
+ if (dsi->ineeded != dsi->oineeded) {
|
|
Panu Matilainen |
2e4024 |
+ rpmpsAppend(ps, RPMPROB_DISKNODES,
|
|
Panu Matilainen |
2e4024 |
rpmteNEVRA(te), rpmteKey(te),
|
|
Panu Matilainen |
2e4024 |
ts->filesystems[i], NULL, NULL,
|
|
Panu Matilainen |
2e4024 |
- (adj_fs_blocks(dsi->ineeded) - dsi->iavail));
|
|
Panu Matilainen |
2e4024 |
+ (adj_fs_blocks(dsi->ineeded) - dsi->iavail));
|
|
Panu Matilainen |
2e4024 |
+ dsi->oineeded = dsi->ineeded;
|
|
Panu Matilainen |
2e4024 |
+ }
|
|
Panu Matilainen |
2e4024 |
}
|
|
Panu Matilainen |
2e4024 |
}
|
|
Panu Matilainen |
2e4024 |
ps = rpmpsFree(ps);
|
|
Panu Matilainen |
2e4024 |
diff --git a/lib/rpmts_internal.h b/lib/rpmts_internal.h
|
|
Panu Matilainen |
2e4024 |
index 6189fc1..1b0f847 100644
|
|
Panu Matilainen |
2e4024 |
--- a/lib/rpmts_internal.h
|
|
Panu Matilainen |
2e4024 |
+++ b/lib/rpmts_internal.h
|
|
Panu Matilainen |
2e4024 |
@@ -20,6 +20,8 @@ struct diskspaceInfo_s {
|
|
Panu Matilainen |
2e4024 |
int64_t bsize; /*!< File system block size. */
|
|
Panu Matilainen |
2e4024 |
int64_t bavail; /*!< No. of blocks available. */
|
|
Panu Matilainen |
2e4024 |
int64_t iavail; /*!< No. of inodes available. */
|
|
Panu Matilainen |
2e4024 |
+ int64_t obneeded; /*!< Bookkeeping to avoid duplicate reports */
|
|
Panu Matilainen |
2e4024 |
+ int64_t oineeded; /*!< Bookkeeping to avoid duplicate reports */
|
|
Panu Matilainen |
2e4024 |
};
|
|
Panu Matilainen |
2e4024 |
|
|
Panu Matilainen |
2e4024 |
/** \ingroup rpmts
|