From patchwork Sun Apr 21 09:42:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 63255 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DCAE927BBEA; Sun, 21 Apr 2024 10:45:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6057F27BBE2 for ; Sun, 21 Apr 2024 10:45:00 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryTjy-0005XJ-RD; Sun, 21 Apr 2024 05:44:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryTjl-0005Qb-6O for guix-patches@gnu.org; Sun, 21 Apr 2024 05:43:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ryTjk-0002md-EO; Sun, 21 Apr 2024 05:43:52 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ryTjx-0006U7-J3; Sun, 21 Apr 2024 05:44:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70494] [PATCH 08/23] store: Add text-output-path and text-output-path-from-hash. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sun, 21 Apr 2024 09:44:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70494 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70494@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 70494-submit@debbugs.gnu.org id=B70494.171369260624475 (code B ref 70494); Sun, 21 Apr 2024 09:44:05 +0000 Received: (at 70494) by debbugs.gnu.org; 21 Apr 2024 09:43:26 +0000 Received: from localhost ([127.0.0.1]:41766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryTjJ-0006MQ-13 for submit@debbugs.gnu.org; Sun, 21 Apr 2024 05:43:26 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryTix-0006I0-KR for 70494@debbugs.gnu.org; Sun, 21 Apr 2024 05:43:05 -0400 Received: from localhost (unknown [212.132.255.10]) by mira.cbaines.net (Postfix) with ESMTPSA id 70C0327BBF0 for <70494@debbugs.gnu.org>; Sun, 21 Apr 2024 10:42:47 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id f194f578 for <70494@debbugs.gnu.org>; Sun, 21 Apr 2024 09:42:46 +0000 (UTC) From: Christopher Baines Date: Sun, 21 Apr 2024 10:42:26 +0100 Message-ID: <07a1cd0965422c6bdbcdf52834cd33cee7951114.1713692561.git.mail@cbaines.net> X-Mailer: git-send-email 2.41.0 In-Reply-To: <87bk632h36.fsf@cbaines.net> References: <87bk632h36.fsf@cbaines.net> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/store.scm (text-output-path, text-output-path-from-hash): New procedures. Change-Id: I38c3aaa0b304dd4f97a222a1065eb1b7f55bbfad --- guix/store.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/guix/store.scm b/guix/store.scm index 578e46507e..b83f205096 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -196,6 +196,8 @@ (define-module (guix store) store-path output-path fixed-output-path + text-output-path + text-output-path-from-hash store-path? direct-store-path? derivation-path? @@ -2280,6 +2282,20 @@ (define* (fixed-output-path name hash (sha256 (string->utf8 tag)) name)))) +(define (text-output-path name text references) + (text-output-path-from-hash + name + (sha256 (string->utf8 text)) + references)) + +(define* (text-output-path-from-hash name text-hash references) + (store-path + (string-append "text" (string-join (sort references string