From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C9774138CD3 for ; Sat, 6 Jun 2015 06:20:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EA4C1E0805; Sat, 6 Jun 2015 06:20:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 87669E07D6 for ; Sat, 6 Jun 2015 06:20:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B61E0340BF7 for ; Sat, 6 Jun 2015 06:20:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5FF74A06 for ; Sat, 6 Jun 2015 06:20:11 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1433568704.b9a5aef5d7c6b7ed55c1441a7f74221bda694a23.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: main.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: b9a5aef5d7c6b7ed55c1441a7f74221bda694a23 X-VCS-Branch: master Date: Sat, 6 Jun 2015 06:20:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9154c24e-63ad-446c-b2c4-4877e82a4bb9 X-Archives-Hash: ad5be605a54364823db165514ffa858d commit: b9a5aef5d7c6b7ed55c1441a7f74221bda694a23 Author: Mike Frysinger gentoo org> AuthorDate: Sat Jun 6 05:31:44 2015 +0000 Commit: Mike Frysinger gentoo 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");