From 20f815592708862a336f1937aa792e5dc356b1b4 Mon Sep 17 00:00:00 2001 From: Attila Lendvai Date: Tue, 17 May 2022 14:35:01 +0200 Subject: use guile's INCLUDE instead of our own way to read a file diff --git a/bin/release-update-helper.scm b/bin/release-update-helper.scm index 6545630..3c8eddb 100755 --- a/bin/release-update-helper.scm +++ b/bin/release-update-helper.scm @@ -129,7 +129,7 @@ (false-if-exception (delete-file db-file)) (with-output-to-file db-file (lambda () - (format #t ";; This file was generated by the ~A script~%" + (format #t ";; This file was generated by the ~A script~%'" (basename (current-filename))) (write db))))) (format #t "Finished successfully~%"))) diff --git a/src/guix-crypto/package-utils.scm b/src/guix-crypto/package-utils.scm index 1877890..680d591 100644 --- a/src/guix-crypto/package-utils.scm +++ b/src/guix-crypto/package-utils.scm @@ -21,26 +21,7 @@ #:use-module (guix diagnostics) #:use-module (guix packages) #:use-module (guix ui) - #:use-module (ice-9 match) - #:export (read-module-relative-file)) - -(define (%read-module-relative-file module filename) - (with-input-from-file - (or (search-path %load-path - (string-append (dirname (module-filename module)) - "/" filename)) - (error "%read-module-relative-file failed for" filename)) - read)) - -(define-syntax read-module-relative-file - (lambda (syn) - (syntax-case syn () - ((_ filename) - (with-syntax - ;; Read the file at compile time and macroexpand to the first form. - ((form (%read-module-relative-file (current-module) - (syntax->datum #'filename)))) - #''form))))) + #:use-module (ice-9 match)) (define-public (unsupported-arch package-name system) (raise (formatted-message diff --git a/src/guix-crypto/packages/bee-binary.hashes b/src/guix-crypto/packages/bee-binary.hashes index 6ddc1c0..382d2c9 100644 --- a/src/guix-crypto/packages/bee-binary.hashes +++ b/src/guix-crypto/packages/bee-binary.hashes @@ -1,2 +1,2 @@ ;; This file was generated by the release-update-helper.scm script -(("aarch64-linux" . "1fjx9hw23dg20k4iz0imd33wsnlwxkjs9z39b4kakzpf4h89wrnl") ("x86_64-linux" . "18hs1mx50hdgqy1xzppfl0mcf7y2h23qs8qr74jzk5f34ixqhg4d") ("i686-linux" . "0fs5wqjh7qvdcmbbnl34m1j4ja7rl831dixaz3bznb4ys7lmlsjr")) \ No newline at end of file +'(("aarch64-linux" . "1fjx9hw23dg20k4iz0imd33wsnlwxkjs9z39b4kakzpf4h89wrnl") ("x86_64-linux" . "18hs1mx50hdgqy1xzppfl0mcf7y2h23qs8qr74jzk5f34ixqhg4d") ("i686-linux" . "0fs5wqjh7qvdcmbbnl34m1j4ja7rl831dixaz3bznb4ys7lmlsjr")) \ No newline at end of file diff --git a/src/guix-crypto/packages/ethereum.scm b/src/guix-crypto/packages/ethereum.scm index 04b5b76..2e8f6e4 100644 --- a/src/guix-crypto/packages/ethereum.scm +++ b/src/guix-crypto/packages/ethereum.scm @@ -43,7 +43,7 @@ (let* ((commit-hash "25c9b49f") ; first 8 digits of the tagged commit's hash (version "1.10.17") ;; Note: use bin/geth-update-helper.scm to update the hashes - (hashes (read-module-relative-file "geth-binary.hashes"))) + (hashes (include "geth-binary.hashes"))) (package (name "geth-binary") (version version) @@ -150,7 +150,7 @@ programming language.") (let* ((version "1.12.8") (commit "2d3dd48") ;; Note: use bin/geth-update-helper.scm to update the hashes - (hashes (read-module-relative-file "nethermind-binary.hashes"))) + (hashes (include "nethermind-binary.hashes"))) (package (name "nethermind-binary") (version version) diff --git a/src/guix-crypto/packages/geth-binary.hashes b/src/guix-crypto/packages/geth-binary.hashes index 090f8ae..61c919f 100644 --- a/src/guix-crypto/packages/geth-binary.hashes +++ b/src/guix-crypto/packages/geth-binary.hashes @@ -1,2 +1,2 @@ ;; This file was generated by the release-update-helper.scm script -(("aarch64-linux" . "19100yqrd7z8f9cga4a52hygv93wn3syhi7ix4hi9km34v1qi89d") ("x86_64-linux" . "1kljbr3ks2dn6jd87k7l0xaasbk82rrxmaxjkm2vy7cvaxwaq0cw") ("i686-linux" . "05pbyc2wwqla262r09iwv506mfwih31i7ln5zyiy82hkvbdv8d4n")) \ No newline at end of file +'(("aarch64-linux" . "19100yqrd7z8f9cga4a52hygv93wn3syhi7ix4hi9km34v1qi89d") ("x86_64-linux" . "1kljbr3ks2dn6jd87k7l0xaasbk82rrxmaxjkm2vy7cvaxwaq0cw") ("i686-linux" . "05pbyc2wwqla262r09iwv506mfwih31i7ln5zyiy82hkvbdv8d4n")) \ No newline at end of file diff --git a/src/guix-crypto/packages/nethermind-binary.hashes b/src/guix-crypto/packages/nethermind-binary.hashes index 1f72dc9..e020b79 100644 --- a/src/guix-crypto/packages/nethermind-binary.hashes +++ b/src/guix-crypto/packages/nethermind-binary.hashes @@ -1,2 +1,2 @@ ;; This file was generated by the release-update-helper.scm script -(("aarch64-linux" . "1mshp5pqmfn02l6n9v8qj8f6nn6q88jb9rh469mnmbswmr5zsq61") ("x86_64-linux" . "1fzs12c24a38a6xjl94mq2b8q7h6hmf3waw4jacl1xvfqv3w49rw")) \ No newline at end of file +'(("aarch64-linux" . "1mshp5pqmfn02l6n9v8qj8f6nn6q88jb9rh469mnmbswmr5zsq61") ("x86_64-linux" . "1fzs12c24a38a6xjl94mq2b8q7h6hmf3waw4jacl1xvfqv3w49rw")) \ No newline at end of file diff --git a/src/guix-crypto/packages/swarm.scm b/src/guix-crypto/packages/swarm.scm index fb49359..8b33adf 100644 --- a/src/guix-crypto/packages/swarm.scm +++ b/src/guix-crypto/packages/swarm.scm @@ -37,7 +37,7 @@ (define-public bee-binary (let ((version "1.6.0") ;; Note: use bin/geth-update-helper.scm to update the hashes - (hashes (read-module-relative-file "bee-binary.hashes"))) + (hashes (include "bee-binary.hashes"))) (package (name "bee-binary") (version version) diff --git a/src/guix-crypto/packages/zcash-binary.hashes b/src/guix-crypto/packages/zcash-binary.hashes index 267fc7e..51ba55c 100644 --- a/src/guix-crypto/packages/zcash-binary.hashes +++ b/src/guix-crypto/packages/zcash-binary.hashes @@ -1,2 +1,2 @@ ;; This file was generated by the release-update-helper.scm script -(("x86_64-linux" . "1c6hfli4wbdw2im51ak1yfg59xnsv33qsiilr24nygbxdp6p1awm")) \ No newline at end of file +'(("x86_64-linux" . "1c6hfli4wbdw2im51ak1yfg59xnsv33qsiilr24nygbxdp6p1awm")) \ No newline at end of file diff --git a/src/guix-crypto/packages/zcash.scm b/src/guix-crypto/packages/zcash.scm index 40ef90e..1ca4732 100644 --- a/src/guix-crypto/packages/zcash.scm +++ b/src/guix-crypto/packages/zcash.scm @@ -40,7 +40,7 @@ (define-public zcash-binary ;; Note: use bin/geth-update-helper.scm to update the hashes - (let ((hashes (read-module-relative-file "zcash-binary.hashes"))) + (let ((hashes (include "zcash-binary.hashes"))) (package (name "zcash-binary") (version "4.7.0")