(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.
|
||||
(define-library (zilch nix path)
|
||||
(import
|
||||
(scheme base)
|
||||
(scheme base) (srfi 152)
|
||||
(zilch lib hash) (zilch nix hash))
|
||||
|
||||
(export
|
||||
%store-dir
|
||||
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
|
||||
;; The path to the store dir, as a parameter.
|
||||
|
|
@ -61,4 +62,9 @@
|
|||
(sha256
|
||||
(string->utf8
|
||||
(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