diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2010-08-14 08:34:01 +0200 |
---|---|---|
committer | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2010-08-27 19:49:28 +0200 |
commit | e9cceec734dafd433b7038228fe4cf80f7adf5fb (patch) | |
tree | ae7c0d9fc2870adae20ac58d90f3073c3248cb25 /tests/base.at | |
parent | 55f532e539427ff5829790fd71b6f8c6342b141a (diff) | |
download | autoconf-e9cceec734dafd433b7038228fe4cf80f7adf5fb.tar.gz |
Try to update config.cache atomically; respect symlinks.
* lib/autoconf/general.m4 (AC_CACHE_SAVE): Use `mv -f' to update
the cache file if it is a regular file and not a symlink. Move
first to temporary name in the target directory if not in the
current directory for atomicity across mount points.
* tests/base.at (AC_CACHE_CHECK): Try symlinked cache file.
* doc/autoconf.texi (Cache Files): Leftover temporary cache
files may be deleted by the user.
* NEWS: Update.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Diffstat (limited to 'tests/base.at')
-rw-r--r-- | tests/base.at | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/base.at b/tests/base.at index f21e7770..cf120997 100644 --- a/tests/base.at +++ b/tests/base.at @@ -457,6 +457,15 @@ AT_CHECK_CONFIGURE([], [], [stdout]) AT_CHECK([grep cache stdout], [1]) AT_CHECK([LC_ALL=C ls -t config.cache a-stamp-file | sed 1q | grep config.cache], [1]) +# Using a symlinked cache file works. +: > cache +rm -f config.cache +AS_LN_S([cache], [config.cache]) +AT_CHECK_CONFIGURE([-C]) +# Either the system does not support symlinks, or the symlinked-to file +# should be updated. +AT_CHECK([test -s cache || test ! -h config.cache]) + # config.site can specify a site-wide cache, accumulating information. # Also test that we don't run afoul of sourcing a file with leading -. AT_DATA([-config.site], |