1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Check for go/scm mtime ordering rather than equality.

* am/guilec (install-data-hook): Remove.
  (guile_install_go_files): New variable.
  ($(guile_install_go_files)): New dependency.

* libguile/load.c (compiled_is_fresh): Check for ordering of STAT_SOURCE
  and STAT_COMPILED, not equality.

* module/ice-9/boot-9.scm (load): Ditto.

* module/system/base/compile.scm (call-with-output-file/atomic): Don't
  set the timestamp of TEMPLATE.
This commit is contained in:
Ludovic Courtès 2010-07-26 11:56:25 +02:00
parent a2a95453eb
commit fefd60ba4b
4 changed files with 10 additions and 26 deletions

View file

@ -11,24 +11,13 @@ EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES)
CLEANFILES = $(GOBJECTS)
# Well, shit. We can't have install changing timestamps, can we? But
# install_sh doesn't know how to preserve timestamps. Soooo, fondle
# automake to make things happen.
install-data-hook:
@$(am__vpath_adj_setup) \
list='$(nobase_mod_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__vpath_adj) \
echo " touch -r '$$d$$p' '$(DESTDIR)$(moddir)/$$f'"; \
touch -r "$$d$$p" "$(DESTDIR)$(moddir)/$$f"; \
done
@$(am__vpath_adj_setup) \
list='$(nobase_ccache_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__vpath_adj) \
echo " touch -r '$$d$$p' '$(DESTDIR)$(ccachedir)/$$f'"; \
touch -r "$$d$$p" "$(DESTDIR)$(ccachedir)/$$f"; \
done
# Make sure source files are installed first, so that the mtime of
# installed compiled files is greater than that of installed source
# files. See
# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
# for details.
guile_install_go_files = install-nobase_ccacheDATA
$(guile_install_go_files): install-nobase_modDATA
AM_V_GUILEC = $(AM_V_GUILEC_$(V))
AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))

View file

@ -614,10 +614,10 @@ compiled_is_fresh (SCM full_filename, SCM compiled_filename)
source = scm_to_locale_string (full_filename);
compiled = scm_to_locale_string (compiled_filename);
if (stat (source, &stat_source) == 0
&& stat (compiled, &stat_compiled) == 0
&& stat_source.st_mtime == stat_compiled.st_mtime)
&& stat_source.st_mtime <= stat_compiled.st_mtime)
{
res = 1;
}

View file

@ -1116,7 +1116,7 @@ If there is no handler at all, Guile prints an error and then exits."
(lambda ()
(let* ((scmstat (stat name))
(gostat (stat go-path #f)))
(if (and gostat (= (stat:mtime gostat) (stat:mtime scmstat)))
(if (and gostat (>= (stat:mtime gostat) (stat:mtime scmstat)))
go-path
(begin
(if gostat

View file

@ -81,11 +81,6 @@
(proc tmp)
(chmod tmp (logand #o0666 (lognot (umask))))
(close-port tmp)
(if reference
(let ((st (stat reference)))
(utime template
(stat:atime st) (stat:mtime st)
(stat:atimensec st) (stat:mtimensec st))))
(rename-file template filename))
(lambda args
(delete-file template)))))))