commit:     f031a1315e1363857959cdae24414a7845cc1660
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 20:10:10 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 20:10:10 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f031a131

qcache: only warn once per missing cache file

When the cache is out of date, we can spam hundreds of lines.
Only do it once.

 qcache.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/qcache.c b/qcache.c
index 9e41c3c..fed3534 100644
--- a/qcache.c
+++ b/qcache.c
@@ -578,9 +578,14 @@ int qcache_traverse(void (*func)(qcache_data*))
                                                func(&data);
 
                                        qcache_free_data(data.cache_data);
-                               } else
-                                       warnp("unable to read cache '%s'\n"
-                                             "\tperhaps you need to `egencache 
-j 4` ?", cachepath);
+                               } else {
+                                       static bool warned = false;
+                                       if (!warned) {
+                                               warned = true;
+                                               warnp("unable to read cache 
'%s'\n"
+                                                     "\tperhaps you need to 
`egencache -j 4` ?", cachepath);
+                                       }
+                               }
 
                                free(ebuilds[k]);
                                free(cachepath);

Reply via email to