mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
utils: Treat 'configure' and Makefiles with an 8-bit encoding.
* guix/build/utils.scm (patch-makefile-SHELL, patch-/usr/bin/file): Wrap 'substitute*' in 'with-fluids'. Fixes <http://hydra.gnu.org/build/262895>.
This commit is contained in:
parent
4db87162e6
commit
dd0a8ef15f
1 changed files with 21 additions and 17 deletions
|
@ -712,6 +712,8 @@ (define (find-shell name)
|
|||
shell))
|
||||
|
||||
(let ((st (stat file)))
|
||||
;; Consider FILE is using an 8-bit encoding to avoid errors.
|
||||
(with-fluids ((%default-port-encoding #f))
|
||||
(substitute* file
|
||||
(("^ *SHELL[[:blank:]]*:?=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)(.*)$"
|
||||
_ dir shell args)
|
||||
|
@ -721,7 +723,7 @@ (define (find-shell name)
|
|||
(format (current-error-port)
|
||||
"patch-makefile-SHELL: ~a: changing `SHELL' from `~a' to `~a'~%"
|
||||
file old new))
|
||||
(string-append "SHELL = " new args))))
|
||||
(string-append "SHELL = " new args)))))
|
||||
|
||||
(when keep-mtime?
|
||||
(set-file-time file st))))
|
||||
|
@ -738,13 +740,15 @@ (define* (patch-/usr/bin/file file
|
|||
"patch-/usr/bin/file: warning: \
|
||||
no replacement 'file' command, doing nothing~%")
|
||||
(let ((st (stat file)))
|
||||
;; Consider FILE is using an 8-bit encoding to avoid errors.
|
||||
(with-fluids ((%default-port-encoding #f))
|
||||
(substitute* file
|
||||
(("/usr/bin/file")
|
||||
(begin
|
||||
(format (current-error-port)
|
||||
"patch-/usr/bin/file: ~a: changing `~a' to `~a'~%"
|
||||
file "/usr/bin/file" file-command)
|
||||
file-command)))
|
||||
file-command))))
|
||||
|
||||
(when keep-mtime?
|
||||
(set-file-time file st)))))
|
||||
|
|
Loading…
Reference in a new issue