build-system/gnu: Do not patch symlinks in the source.
This is a followup to 13a9feb5b64fd819eaed38a17da0284bbe2b8d9. * guix/build/gnu-build-system.scm (patch-source-shebangs): Remove call to 'remove'. Pass a second argument to 'find-files' to filter out symlinks; pass #:stat lstat. (patch-generated-file-shebangs): Likewise, and also filter out non-executable files.
This commit is contained in:
parent
e7e43727ce
commit
5c9632c75a
|
@ -172,22 +172,23 @@ files such as `.in' templates. Most scripts honor $SHELL and
|
||||||
$CONFIG_SHELL, but some don't, such as `mkinstalldirs' or Automake's
|
$CONFIG_SHELL, but some don't, such as `mkinstalldirs' or Automake's
|
||||||
`missing' script."
|
`missing' script."
|
||||||
(for-each patch-shebang
|
(for-each patch-shebang
|
||||||
(remove (lambda (file)
|
(find-files "."
|
||||||
(or (not (file-exists? file)) ;dangling symlink
|
(lambda (file stat)
|
||||||
(file-is-directory? file)))
|
;; Filter out symlinks.
|
||||||
(find-files "."))))
|
(eq? 'regular (stat:type stat)))
|
||||||
|
#:stat lstat)))
|
||||||
|
|
||||||
(define (patch-generated-file-shebangs . rest)
|
(define (patch-generated-file-shebangs . rest)
|
||||||
"Patch shebangs in generated files, including `SHELL' variables in
|
"Patch shebangs in generated files, including `SHELL' variables in
|
||||||
makefiles."
|
makefiles."
|
||||||
;; Patch executable files, some of which might have been generated by
|
;; Patch executable regular files, some of which might have been generated
|
||||||
;; `configure'.
|
;; by `configure'.
|
||||||
(for-each patch-shebang
|
(for-each patch-shebang
|
||||||
(filter (lambda (file)
|
(find-files "."
|
||||||
(and (file-exists? file)
|
(lambda (file stat)
|
||||||
(executable-file? file)
|
(and (eq? 'regular (stat:type stat))
|
||||||
(not (file-is-directory? file))))
|
(not (zero? (logand (stat:mode stat) #o100)))))
|
||||||
(find-files ".")))
|
#:stat lstat))
|
||||||
|
|
||||||
;; Patch `SHELL' in generated makefiles.
|
;; Patch `SHELL' in generated makefiles.
|
||||||
(for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$")))
|
(for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$")))
|
||||||
|
|
Loading…
Reference in New Issue