mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-05 19:50:23 +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 () (autoload-in-progress! dir-hint name))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let ((file (in-vicinity dir-hint name)))
|
(let ((file (in-vicinity dir-hint name)))
|
||||||
(cond ((and load-compiled
|
(let ((compiled (and load-compiled
|
||||||
(%search-load-path (string-append file ".go")))
|
(%search-load-path
|
||||||
=> (lambda (full)
|
(string-append file ".go"))))
|
||||||
(load-file load-compiled full)))
|
(source (%search-load-path file)))
|
||||||
((%search-load-path file)
|
(cond ((and source
|
||||||
=> (lambda (full)
|
(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))
|
(with-fluids ((current-reader #f))
|
||||||
(load-file primitive-load full)))))))
|
(load-file primitive-load source)))
|
||||||
|
(compiled
|
||||||
|
(load-file load-compiled compiled))))))
|
||||||
(lambda () (set-autoloaded! dir-hint name didit)))
|
(lambda () (set-autoloaded! dir-hint name didit)))
|
||||||
didit))))
|
didit))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue