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.
This commit is contained in:
Efraim Flashner 2019-08-12 13:57:44 +03:00
parent 5e5cdac0ae
commit 17c26b7ec5
No known key found for this signature in database
GPG Key ID: 41AAE7DCCA3D8351
2 changed files with 15 additions and 16 deletions

View File

@ -40,21 +40,6 @@
;;
;; Code:
;; TODO: Move this to (guix build cargo-utils). Will cause a full rebuild
;; of all rust compilers.
(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$")))
(define (manifest-targets)
"Extract all targets from the Cargo.toml manifest"
(let* ((port (open-input-pipe "cargo read-manifest"))

View File

@ -2,6 +2,7 @@
;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; 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$")))