commit:     b9a5aef5d7c6b7ed55c1441a7f74221bda694a23
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  6 05:31:44 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Jun  6 05:31:44 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b9a5aef5

cache: do not reinit every time

The rework accidentally changed the behavior so we would rebuild the
cache everytime we tried to load it.

 main.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/main.c b/main.c
index cb180df..df1e309 100644
--- a/main.c
+++ b/main.c
@@ -936,12 +936,11 @@ initialize_flat(int cache_type, bool force)
        xasprintf(&cache_file, "%s/dep/%s/%s", portedb, portdir,
                (cache_type == CACHE_EBUILD ? ".ebuild.x" : ".metadata.x"));
 
-       if (stat(cache_file, &st) != -1) {
-               if (st.st_size == 0)
-                       unlink(cache_file);
-       } else if (!force) {
-               /* assuming --sync is used with --delete this will get 
recreated after every merge */
-               goto ret;
+       /* If we aren't forcing a regen, make sure the file is somewhat sane. */
+       if (!force) {
+               if (stat(cache_file, &st) != -1)
+                       if (st.st_size)
+                               goto ret;
        }
        if (!quiet)
                warn("Updating ebuild %scache ... ", cache_type == CACHE_EBUILD 
? "" : "meta");

Reply via email to