From 17c26b7ec52b21f19234eaf160036ad400071eb0 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 12 Aug 2019 13:57:44 +0300 Subject: build/cargo-build-system: Move generate-all-checksums to cargo-utils. * guix/build/cargo-build-system.scm (generate-all-checksums): Move procedure ... * guix/build/cargo-utils.scm: ... to here. --- guix/build/cargo-utils.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'guix/build/cargo-utils.scm') diff --git a/guix/build/cargo-utils.scm b/guix/build/cargo-utils.scm index 79e5440378..5ac429a62a 100644 --- a/guix/build/cargo-utils.scm +++ b/guix/build/cargo-utils.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016 David Craven ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Ivan Petkov +;;; Copyright © 2019 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,7 +23,8 @@ #:use-module (guix build utils) #:use-module (ice-9 popen) #:use-module (ice-9 rdelim) - #:export (generate-checksums)) + #:export (generate-checksums + generate-all-checksums)) ;; Commentary: ;; @@ -66,3 +68,15 @@ the same directory." (display "},\"package\":" port) (write (file-sha256 "/dev/null") port) (display "}" port))))) + +(define (generate-all-checksums dir-name) + (for-each + (lambda (filename) + (let* ((dir (dirname filename)) + (checksum-file (string-append dir "/.cargo-checksum.json"))) + (when (file-exists? checksum-file) (delete-file checksum-file)) + (display (string-append + "patch-cargo-checksums: generate-checksums for " + dir "\n")) + (generate-checksums dir))) + (find-files dir-name "Cargo.toml$"))) -- cgit v1.2.3