(zilch nix path): support content-addressed paths with references
This commit is contained in:
parent
f8dd673609
commit
9d72e8a246
1 changed files with 9 additions and 3 deletions
|
|
@ -3,13 +3,14 @@
|
||||||
;; These helpers all use the `%store-dir` parameter as base store directory.
|
;; These helpers all use the `%store-dir` parameter as base store directory.
|
||||||
(define-library (zilch nix path)
|
(define-library (zilch nix path)
|
||||||
(import
|
(import
|
||||||
(scheme base)
|
(scheme base) (srfi 152)
|
||||||
(zilch lib hash) (zilch nix hash))
|
(zilch lib hash) (zilch nix hash))
|
||||||
|
|
||||||
(export
|
(export
|
||||||
%store-dir
|
%store-dir
|
||||||
impure-placeholder make-upstream-output-placeholder make-placeholder
|
impure-placeholder make-upstream-output-placeholder make-placeholder
|
||||||
make-store-path-from-parts make-text-path make-fixed-output-path make-output-path)
|
make-store-path-from-parts make-text-path make-fixed-output-path make-output-path
|
||||||
|
make-fixed-output-with-references)
|
||||||
|
|
||||||
(begin
|
(begin
|
||||||
;; The path to the store dir, as a parameter.
|
;; The path to the store dir, as a parameter.
|
||||||
|
|
@ -61,4 +62,9 @@
|
||||||
(sha256
|
(sha256
|
||||||
(string->utf8
|
(string->utf8
|
||||||
(string-append "fixed:out:" (if recursive "r:" "") hash-algo ":" (hex hash-value) ":")))
|
(string-append "fixed:out:" (if recursive "r:" "") hash-algo ":" (hex hash-value) ":")))
|
||||||
name)))))
|
name)))
|
||||||
|
|
||||||
|
(define (make-fixed-output-with-references hash-value name references self-references)
|
||||||
|
(make-store-path-from-parts
|
||||||
|
(string-join (append (cons "source" references) (if self-references '("self") '())) ":")
|
||||||
|
"sha256" hash-value name))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue