GNU bug report logs - #70494
[PATCH 00/23] Groundwork for the Guile guix-daemon

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sun, 21 Apr 2024 09:37:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Christopher Baines <mail <at> cbaines.net>
To: 70494 <at> debbugs.gnu.org
Cc: Christopher Baines <guix <at> cbaines.net>, Josselin Poiret <dev <at> jpoiret.xyz>, Ludovic Courtès <ludo <at> gnu.org>, Mathieu Othacehe <othacehe <at> gnu.org>, Ricardo Wurmus <rekado <at> elephly.net>, Simon Tournier <zimon.toutoune <at> gmail.com>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: [bug#70494] [PATCH 08/23] store: Add text-output-path and text-output-path-from-hash.
Date: Sun, 21 Apr 2024 10:42:26 +0100
* 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<?)
+                                      ":"
+                                      'prefix))
+   text-hash
+   name))
+
 (define (store-path? path)
   "Return #t if PATH is a store path."
   ;; This is a lightweight check, compared to using a regexp, but this has to
-- 
2.41.0





This bug report was last modified 1 year and 28 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.