mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-31 17:30:24 +02:00
warn and load source file if newer than compile file
* ice-9/boot-9.scm (try-module-autoload): Warn if the compiled file is older than the source file, and in that case load the source file.
This commit is contained in:
parent
e6d4e05cbd
commit
707b812ef4
1 changed files with 14 additions and 8 deletions
|
@ -2166,14 +2166,20 @@ module '(ice-9 q) '(make-q q-length))}."
|
|||
(lambda () (autoload-in-progress! dir-hint name))
|
||||
(lambda ()
|
||||
(let ((file (in-vicinity dir-hint name)))
|
||||
(cond ((and load-compiled
|
||||
(%search-load-path (string-append file ".go")))
|
||||
=> (lambda (full)
|
||||
(load-file load-compiled full)))
|
||||
((%search-load-path file)
|
||||
=> (lambda (full)
|
||||
(with-fluids ((current-reader #f))
|
||||
(load-file primitive-load full)))))))
|
||||
(let ((compiled (and load-compiled
|
||||
(%search-load-path
|
||||
(string-append file ".go"))))
|
||||
(source (%search-load-path file)))
|
||||
(cond ((and source
|
||||
(or (not compiled)
|
||||
(< (stat:mtime (stat compiled))
|
||||
(stat:mtime (stat source)))))
|
||||
(if compiled
|
||||
(warn "source file" source "newer than" compiled))
|
||||
(with-fluids ((current-reader #f))
|
||||
(load-file primitive-load source)))
|
||||
(compiled
|
||||
(load-file load-compiled compiled))))))
|
||||
(lambda () (set-autoloaded! dir-hint name didit)))
|
||||
didit))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue