diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2020-05-19 15:55:08 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2020-05-22 01:29:39 +0200 |
| commit | ce0be5675b702b2ff89aed1772ebb42af4150243 (patch) | |
| tree | ec275112c97e9450ed9c4a8d30e7c153a7c10786 /tests/store.scm | |
| parent | 56f7ca6e7c8b5eadeee48b00bcbd78f9fa9e5f43 (diff) | |
packages: Introduce <content-hash> and use it in <origin>.
* guix/packages.scm (<content-hash>): New record type.
(define-content-hash-constructor, build-content-hash)
(content-hash): New macros.
(print-content-hash): New procedure.
(<origin>): Rename constructor to '%origin'.
[sha256]: Remove field.
[hash]: New field. Adjust users.
(origin-compatibility-helper, origin): New macros.
(origin-sha256): New deprecated procedure.
(origin->derivation): Adjust accordingly.
* tests/packages.scm ("package-source-derivation, origin, sha512"): New
test.
* guix/tests.scm: Hide (gcrypt hash) 'sha256' for proper syntax
matching.
* tests/challenge.scm: Add #:prefix for (gcrypt hash) and adjust users.
* tests/derivations.scm: Likewise.
* tests/store.scm: Likewise.
* tests/graph.scm ("bag DAG, including origins"): Provide 'sha256' field
with the right length.
* gnu/packages/aspell.scm (aspell-dictionary)
(aspell-dict-ca, aspell-dict-it): Use 'hash' and 'content-hash' for
proper syntax matching.
* gnu/packages/bash.scm (bash-patch): Rename 'sha256' to 'sha256-bv'.
* gnu/packages/bootstrap.scm (bootstrap-executable): Rename 'sha256' to 'bv'.
* gnu/packages/readline.scm (readline-patch): Likewise.
* gnu/packages/virtualization.scm (qemu-patch): Rename 'sha256' to
'sha256-bv'.
* guix/import/utils.scm: Hide (gcrypt hash) 'sha256'.
Diffstat (limited to 'tests/store.scm')
| -rw-r--r-- | tests/store.scm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/store.scm b/tests/store.scm index f007846dc16..06f79396579 100644 --- a/tests/store.scm +++ b/tests/store.scm | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | #:use-module (guix store) | 22 | #:use-module (guix store) |
| 23 | #:use-module (guix utils) | 23 | #:use-module (guix utils) |
| 24 | #:use-module (guix monads) | 24 | #:use-module (guix monads) |
| 25 | #:use-module (gcrypt hash) | 25 | #:use-module ((gcrypt hash) #:prefix gcrypt:) |
| 26 | #:use-module (guix base32) | 26 | #:use-module (guix base32) |
| 27 | #:use-module (guix packages) | 27 | #:use-module (guix packages) |
| 28 | #:use-module (guix derivations) | 28 | #:use-module (guix derivations) |
| @@ -321,7 +321,7 @@ | |||
| 321 | #:env-vars `(("t2" . ,t2)))) | 321 | #:env-vars `(("t2" . ,t2)))) |
| 322 | (o (derivation->output-path d))) | 322 | (o (derivation->output-path d))) |
| 323 | (with-derivation-narinfo d | 323 | (with-derivation-narinfo d |
| 324 | (sha256 => (sha256 (string->utf8 t2))) | 324 | (sha256 => (gcrypt:sha256 (string->utf8 t2))) |
| 325 | (references => (list t2)) | 325 | (references => (list t2)) |
| 326 | 326 | ||
| 327 | (equal? (references/substitutes s (list o t3 t2 t1)) | 327 | (equal? (references/substitutes s (list o t3 t2 t1)) |
| @@ -940,7 +940,7 @@ | |||
| 940 | (foldm %store-monad | 940 | (foldm %store-monad |
| 941 | (lambda (item result) | 941 | (lambda (item result) |
| 942 | (define ref-hash | 942 | (define ref-hash |
| 943 | (let-values (((port get) (open-sha256-port))) | 943 | (let-values (((port get) (gcrypt:open-sha256-port))) |
| 944 | (write-file item port) | 944 | (write-file item port) |
| 945 | (close-port port) | 945 | (close-port port) |
| 946 | (get))) | 946 | (get))) |
| @@ -1144,7 +1144,7 @@ | |||
| 1144 | (info (query-path-info %store item))) | 1144 | (info (query-path-info %store item))) |
| 1145 | (and (equal? (path-info-references info) (list ref)) | 1145 | (and (equal? (path-info-references info) (list ref)) |
| 1146 | (equal? (path-info-hash info) | 1146 | (equal? (path-info-hash info) |
| 1147 | (sha256 | 1147 | (gcrypt:sha256 |
| 1148 | (string->utf8 | 1148 | (string->utf8 |
| 1149 | (call-with-output-string (cut write-file item <>)))))))) | 1149 | (call-with-output-string (cut write-file item <>)))))))) |
| 1150 | 1150 | ||
