From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id S09yGIZkWGFABQEAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 15:54:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UO5sE4ZkWGFUNQAAB5/wlQ (envelope-from ) for ; Sat, 02 Oct 2021 13:54:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E00F23070D for ; Sat, 2 Oct 2021 15:54:13 +0200 (CEST) Received: from localhost ([::1]:35728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWfSv-0007dZ-4u for larch@yhetil.org; Sat, 02 Oct 2021 09:54:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWfRm-0006JF-Km for guix-patches@gnu.org; Sat, 02 Oct 2021 09:53:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWfRm-0001jB-Di for guix-patches@gnu.org; Sat, 02 Oct 2021 09:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWfRm-00037H-CY for guix-patches@gnu.org; Sat, 02 Oct 2021 09:53:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 13:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50960 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 50960@debbugs.gnu.org Received: via spool by 50960-submit@debbugs.gnu.org id=B50960.163318276111929 (code B ref 50960); Sat, 02 Oct 2021 13:53:02 +0000 Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:52:41 +0000 Received: from localhost ([127.0.0.1]:58385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfRQ-00036K-My for submit@debbugs.gnu.org; Sat, 02 Oct 2021 09:52:40 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:56102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfRO-000361-8o for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 09:52:39 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id 11sc260050mfAB4061sc3S; Sat, 02 Oct 2021 15:52:36 +0200 Message-ID: <6c199526d88150c31461e3b7f9e76909217e658c.camel@telenet.be> From: Maxime Devos Date: Sat, 02 Oct 2021 15:52:35 +0200 In-Reply-To: <20211002102240.27815-10-ludo@gnu.org> References: <20211002102240.27815-1-ludo@gnu.org> <20211002102240.27815-10-ludo@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-t+LWauDpHLEuDihFj056" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1633182756; bh=omF5ASZoi8snei6ZZr2erB3zRm0VaAk+dejiqYC/ilQ=; h=Subject:From:To:Date:In-Reply-To:References; b=mmL7eKkFsra3UDcugJJ+ZB29FFkoIvdm2ZkK0mUbZcTSyRsn7if8NHEmOjBWH0Vz1 a646AEMrd2k14Zwza4jOijwHIHqoJ9d204KUxc5aRxQgJx3OcpUTaf36qzmLqyKHVw TGI5IgdX6t39fXYqx2fbq/mOyiv5FK8P70e6dyleCIPP5IQXSaCxl0X24RbufCvSa+ Sa/cd13ECAlHdio9l3w/B+7TaSmdLOkobjbrLzv3r2DEmAcda575hLA3IJz+dkK94D fw5GlX75+yYyEyapV8LRco0At6CnQ4BpwTO5fHQ5AK07dRyjUCGoZu7jzke+sm3R19 YBw0CoqpHQgMA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633182853; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=omF5ASZoi8snei6ZZr2erB3zRm0VaAk+dejiqYC/ilQ=; b=BsQL/us/+er+6iuoAaIcIRMsjeA8rX6M2dhnkri2ffCd/GCYZ6a6eXYZITWfAHDHBvjL/g lFTSbeafWESZlZKVMfwtk61OAnQpve2mWHvVAtUfXzXHi6kSYeQRz8cGd9XK2pGwa1Vutz Nv05vY97NZaIWSfkSSt76UZ1uaN+I2e0KhuqdMm36bVzk+doJS6uvLO8ZKf/3yxM84pfx8 /TTw5jlo/8tQyTP+Y/uugzt8ENAkgz3X8YTKIRUt09BguChDthIalZ+TQULMP4DCbYF1dN SFO47llvoN9/+qnrqQBeaehXebaRmK83QPRVUgEvFdiipXZRcRv/apPGuRhx2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633182853; a=rsa-sha256; cv=none; b=NloiV8ooL/zIbknWeYHdwmBBg0DanVJc3fgXY/frDTg1hRPlOvcW2DUj7pFYJBYR1caYhs dhV32HRJAz2HUmzxkF9YVd6RoX2XXavddjmtO+fgp45f7OBtfG3yoo4dPStNxPh1+97yIZ hj2tzsaxokPnR8LZ8c3f28OBKecHfjLsMb+FguHRJrU2Tmo+asXuSw1tmSriJjaannZCq0 A2fMHgvRwHjv3V35LGaMmlI/54RKJOFqndOhzPqFa8+Fpqod3VBQx/Stqgchv8ufEmaHst baaeongoHHzXXAZOEwE8mmLKra2XpqaWduy0Wh2iG10VBkOkMkAcSeATFwO0nQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=mmL7eKkF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=mmL7eKkF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: E00F23070D X-Spam-Score: -3.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: eT2Jsf660csB --=-t+LWauDpHLEuDihFj056 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]: > +(define (profile-cache-key file) > + "Return the cache key for the profile corresponding to FILE, a 'guix.s= cm' or > +'manifest.scm' file, or #f if we lack channel information." > + (match (current-channels) > + (() #f) > + (((=3D channel-commit commits) ...) > + (let ((stat (stat file))) > + (bytevector->base32-string > + (sha256 (string->utf8 > + (string-append (string-join commits) ":" > + (basename file) ":" > + (number->string (stat:dev stat)) ":" > + (number->string (stat:ino stat)))))))))) Why only use the 'basename' of a file name instead of the full name? (Consider the case where a user has multiple "guix.scm" or "manifest.scm".) This turns out to be unproblematic, because stat:dev and stat:ino is includ= ed as well, though including (a part of) the file name is superfluous because stat:dev and stat:ino are included. Could you document the rationale for including the file name, and why only the basename is included instead of the full file name? Greetings, Maxime. --=-t+LWauDpHLEuDihFj056 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVhkIxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ibCAPsGdx+zzlusF1H+ukK1zNmhBuVV dMZ9ckNiSz2XOoQxfAD+JkzSnybdAHlIxyOm/ARE4P8tJDEgxXsKOnX6tYqrlwE= =BuKD -----END PGP SIGNATURE----- --=-t+LWauDpHLEuDihFj056--