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 A58C613888F for ; Fri, 9 Oct 2015 01:33:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F211EE07DB; Fri, 9 Oct 2015 01:33:49 +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 9B424E07DB for ; Fri, 9 Oct 2015 01:33:49 +0000 (UTC) Received: from professor-x (S010634bdfa9ecf80.vc.shawcable.net [96.49.31.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 883E134070F for ; Fri, 9 Oct 2015 01:33:48 +0000 (UTC) Date: Thu, 8 Oct 2015 18:33:01 -0700 From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Subject: Re: [gentoo-catalyst] [PATCH] stagebase: fix path to snapshot hash file Message-ID: <20151008183301.17e00130.dolsen@gentoo.org> In-Reply-To: <1444344777-32497-1-git-send-email-vapier@gentoo.org> References: <1444344777-32497-1-git-send-email-vapier@gentoo.org> Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 1e19d72f-85ae-403e-a945-d98d8bddad77 X-Archives-Hash: 6452d4bb9d9020a0de9b6954a8a606b5 On Thu, 8 Oct 2015 18:52:57 -0400 Mike Frysinger wrote: > When we write the hash, we do so by using: > snapshot_cache_path + / + catalyst-hash > > But when we read it, we do so by: > snapshot_cache_path + catalyst-hash > > If the path lacks a trailing /, then we never read the correct hash > file. The current helper returns -1 on missing file errors which is > compared against the existing hash. In essence, we always trigger a > cache miss. > > Add the missing / to the read logic. > --- > catalyst/base/stagebase.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py > index f81c51b..a2a8520 100644 > --- a/catalyst/base/stagebase.py > +++ b/catalyst/base/stagebase.py > @@ -817,7 +817,7 @@ class StageBase(TargetBase, ClearBase, GenBase): > if "snapcache" in self.settings["options"]: > snapshot_cache_hash=\ > read_from_clst(self.settings["snapshot_cache_path"]+\ > - "catalyst-hash") > + "/" + "catalyst-hash") > unpack_info['mode'] = > self.decompressor.determine_mode( unpack_info['source']) > works for me. It was probably a bug introduced by me removing trailing slashes in pretty much all variables. I kept running into issues with slashes causing problems. Sometimes they were needed other times they caused failures. It was easier to remove them by default then add them only when needed. -- Brian Dolbec