build-system: cargo: Make Cargo.toml writeable.

* guix/build/cargo-build-system.scm (configure): Make sure Cargo.toml
  is writeable before attempting modification.

Problem reported by Danny Milosavljevic <dannym@scratchpost.org>.
This commit is contained in:
David Craven 2017-01-01 16:11:55 +01:00
parent 395bbfdbea
commit dc77498c1c
No known key found for this signature in database
GPG Key ID: C5E051C79C0BECDB
1 changed files with 2 additions and 0 deletions

View File

@ -43,6 +43,8 @@
(define* (configure #:key inputs #:allow-other-keys)
"Replace Cargo.toml [dependencies] section with guix inputs."
;; Make sure Cargo.toml is writeable when the crate uses git-fetch.
(chmod "Cargo.toml" #o644)
(let ((port (open-file "Cargo.toml" "a" #:encoding "utf-8")))
(format port "~%[replace]~%")
(for-each