diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-04-23 11:59:35 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-04-23 18:52:40 +0200 |
commit | cb85eb5e6569378d444b45cf209324e38f6ec0f4 (patch) | |
tree | e13acf5690d2142d2f2447898715793eab95f826 /guix | |
parent | cd91504df27aa0f311735c61f3b7b7ee3fee861a (diff) | |
download | gnu-guix-cb85eb5e6569378d444b45cf209324e38f6ec0f4.tar gnu-guix-cb85eb5e6569378d444b45cf209324e38f6ec0f4.tar.gz |
build-system/gnu: Gracefully handle dangling symlinks.
Fixes <http://bugs.gnu.org/20081>.
Reported by Tomáš Čech <tcech@suse.cz>.
* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove files
that don't pass 'file-exists?'.
(patch-generated-file-shebangs): Likewise.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build/gnu-build-system.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index c60f8ba162..00422458ab 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -164,7 +164,10 @@ files such as `.in' templates. Most scripts honor $SHELL and $CONFIG_SHELL, but some don't, such as `mkinstalldirs' or Automake's `missing' script." (for-each patch-shebang - (remove file-is-directory? (find-files "." ".*")))) + (remove (lambda (file) + (or (not (file-exists? file)) ;dangling symlink + (file-is-directory? file))) + (find-files ".")))) (define (patch-generated-file-shebangs . rest) "Patch shebangs in generated files, including `SHELL' variables in @@ -173,9 +176,10 @@ makefiles." ;; `configure'. (for-each patch-shebang (filter (lambda (file) - (and (executable-file? file) + (and (file-exists? file) + (executable-file? file) (not (file-is-directory? file)))) - (find-files "." ".*"))) + (find-files "."))) ;; Patch `SHELL' in generated makefiles. (for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$"))) |