From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uCclAGRbfWERIwEAgWs5BA (envelope-from ) for ; Sat, 30 Oct 2021 16:49:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qPh8N2NbfWHnagAA1q6Kng (envelope-from ) for ; Sat, 30 Oct 2021 14:49:07 +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 B9A651AE75 for ; Sat, 30 Oct 2021 16:49:07 +0200 (CEST) Received: from localhost ([::1]:60504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgpfO-00088T-UU for larch@yhetil.org; Sat, 30 Oct 2021 10:49:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpfL-000887-2S for guix-patches@gnu.org; Sat, 30 Oct 2021 10:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgpfK-0007xW-Qr for guix-patches@gnu.org; Sat, 30 Oct 2021 10:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgpfK-0003uv-HA for guix-patches@gnu.org; Sat, 30 Oct 2021 10:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51307] [PATCH 0/2] guix hash: eases conversion Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 14:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51307 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 51307@debbugs.gnu.org Received: via spool by 51307-submit@debbugs.gnu.org id=B51307.163560533515042 (code B ref 51307); Sat, 30 Oct 2021 14:49:02 +0000 Received: (at 51307) by debbugs.gnu.org; 30 Oct 2021 14:48:55 +0000 Received: from localhost ([127.0.0.1]:58137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpfD-0003uY-5y for submit@debbugs.gnu.org; Sat, 30 Oct 2021 10:48:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpfB-0003uK-IB for 51307@debbugs.gnu.org; Sat, 30 Oct 2021 10:48:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpf6-0007wY-4V; Sat, 30 Oct 2021 10:48:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=SghBQjzJax+JS2n3X19tz98zmU9Xv645OZEbXIvNcp8=; b=P+NZXISB5yupucGCC80J ZaVzAVUpoBFFL9mfNpG85PlDR7sQQNC/5yirQyBIxOy66OswL9AJp8UTnhrIYzRXjXn/Ppk2snbnh HQwVr0IVAvPlKnwkJeSm4EFzDLh5DO99Jko7L09IMIA6lhOLKAnuivJlfU+eLVPzXcQ/UfKLSPGmJ GJTom0C4jFCmccXgpnea0w0g2eha2YCLEnX7SlKmRQ99AxrmfdfBrQNn8dUg4jCuGn97h4+s6yM1o NNHnbOkPD8zJwbTObgFvPAu3lD1KmeJD9zEzIbgsdqJaHGlfs3T8grS6Fdfwpwu0WUk4wouTU/GTT yM+qwD1AX3Rpbw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55426 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpf5-0002AW-Lr; Sat, 30 Oct 2021 10:48:47 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211020165435.3358398-1-zimon.toutoune@gmail.com> <20211020165435.3358398-2-zimon.toutoune@gmail.com> Date: Sat, 30 Oct 2021 16:48:45 +0200 In-Reply-To: <20211020165435.3358398-2-zimon.toutoune@gmail.com> (zimoun's message of "Wed, 20 Oct 2021 18:54:35 +0200") Message-ID: <871r42tvoy.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1635605347; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=SghBQjzJax+JS2n3X19tz98zmU9Xv645OZEbXIvNcp8=; b=l+mvjWhncauHc6jNSjF4dsjIOV6jd7rUasaLfYDjRI3YxoFFJEkcaG1TdHUaRdKS0x3yvF e/moiPpGnzG2wa9Ib9qkVsIz+6GOf9Ax95BZxlMO5WLS6TL2QdXu2a5pSQJs7CJbRdE9Is gBj/E3KrstIhPmKjChdHofiI2afDEbVCCFvhlxSzXXVMiUOb7mPtkDFpGxomOgYvy16Vhf DwBaqrfF8fgsE7miqzEr/2QS2mydA29PzHKz/vY8eWRhxN3KUkiFUfxSgxT6OL1CXUtQ27 1rEffkuEp9u0Hxe45DZ6ksdHJFkThjEuWqv8nv7WI0ObXcYtWe8mrlZEkYu4Pw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635605347; a=rsa-sha256; cv=none; b=rkGLU2EC5ljgWskwJhzvEkr8vSw6BtQM0kbxn2K9FeZL34uxxeGCv3JkZnyCVteVsNTzfU ZEIUerr/wwRKvMz7bjsLDSPtYiPvu0A9l3apToWHbzah4bvUQ79n3kNT4qTwlgYq0JksGY 8wAAuRoZOXBvw7gtKKj4N4RDvVSCQA5PH1fi/FmPT1QPL7FArYTaDhpM0oGCNQHmoam1hz iAFysk80Dcpy/+AOPYf2H1S34sqAttunEE15UY3+1QjFPJHwfkymL9u1hc33n53tB7gx5W 9UnIbJ3d20A5o4wPj3ivczszkwd4xJCa7uCVZ++JM436Mr+BtYdJ4jjJqnf/Qg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=P+NZXISB; 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: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=P+NZXISB; dmarc=pass (policy=none) header.from=gnu.org; 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: B9A651AE75 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: ks9J/VkHVp67 zimoun skribis: > * guix/scripts/hash.scm (guix-hash)[package?]: New procedure. > [hash-to-display]: Use it. > * tests/guix-hash.scm: New test. > --- > guix/scripts/hash.scm | 19 +++++++++++++++++-- > tests/guix-hash.sh | 10 ++++++++++ > 2 files changed, 27 insertions(+), 2 deletions(-) > > diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm > index f3363549d3..4f0d41629f 100644 > --- a/guix/scripts/hash.scm > +++ b/guix/scripts/hash.scm > @@ -22,6 +22,9 @@ >=20=20 > (define-module (guix scripts hash) > #:use-module (gcrypt hash) > + #:use-module ((gnu packages) #:select (find-best-packages-by-name)) > + #:use-module (guix packages) > + #:use-module ((guix utils) #:select (package-name->name+version)) I think I would prefer to keep (guix scripts hash) bare-bones, not depending on the package machinery. Most of the time one can run: guix hash $(guix build -S PACKAGE) It=E2=80=99s not quite what you want if the package has patches or a snippe= t, but that=E2=80=99s okay IMO. WDYT? Thanks, Ludo=E2=80=99.