[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#70494] [PATCH 08/23] store: Add text-output-path and text-output-pa
From: |
Christopher Baines |
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
- [bug#70494] [PATCH 07/23] serialization: Export read-byte-string., (continued)
- [bug#70494] [PATCH 07/23] serialization: Export read-byte-string., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 05/23] store: build-derivations: New module., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 16/23] store: database: Log when aborting transactions., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 17/23] store: database: Export transaction helpers., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 04/23] guix: store: environment: New module., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 18/23] guix: http-client: Add network-error?., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 19/23] http-client: Include EPIPE in network-error?., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 20/23] scripts: substitute: Simplify with-timeout usage., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 01/23] store: database: Register derivation outputs., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 21/23] scripts: substitute: Don't enforce cached connections in download-nar., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 08/23] store: Add text-output-path and text-output-path-from-hash.,
Christopher Baines <=
- [bug#70494] [PATCH 09/23] store: Add validate-store-name., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 13/23] syscalls: Add unshare., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 11/23] scripts: substitute: Untangle selecting fast vs small compressions., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 10/23] store: database: Add procedures for querying valid paths., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 12/23] scripts: substitute: Extract script specific output from download-nar., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 23/23] substitutes: Add #:keep-alive? keyword argument to download-nar., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 15/23] store: Export operation-id., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 06/23] store: Export protocol related constants., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 22/23] substitutes: Move download-nar from substitutes script to here., Christopher Baines, 2024/04/21
- [bug#70494] [PATCH 14/23] scripts: perform-download: Support configuring the %store-prefix., Christopher Baines, 2024/04/21