autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.65-87-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.65-87-g5941816
Date: Mon, 14 Jun 2010 20:42:23 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=5941816dd9b61b029990e0bccaf8541a2ea288f3

The branch, master has been updated
       via  5941816dd9b61b029990e0bccaf8541a2ea288f3 (commit)
      from  ee0ecf0c37a41661c42ac9425ba50adb40bea4f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5941816dd9b61b029990e0bccaf8541a2ea288f3
Author: Eric Blake <address@hidden>
Date:   Tue Jun 8 06:25:35 2010 -0600

    Make CONFIG_SITE handling more robust.
    
    * lib/autoconf/general.m4 (AC_SITE_LOAD): Avoid leading - and path
    search, and check for failure to load.
    * tests/base.at (AC_CACHE_CHECK): Enhance test.
    * doc/autoconf.texi (Site Defaults): Mention that CONFIG_SITE
    works best as an absolute path.
    * NEWS: Document the semantic change.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |   10 ++++++++++
 NEWS                    |    3 +++
 doc/autoconf.texi       |    3 ++-
 lib/autoconf/general.m4 |   10 ++++++++--
 tests/base.at           |   18 ++++++++++++++++--
 5 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c0c4bc0..4e75a76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-06-14  Eric Blake  <address@hidden>
+
+       Make CONFIG_SITE handling more robust.
+       * lib/autoconf/general.m4 (AC_SITE_LOAD): Avoid leading - and path
+       search, and check for failure to load.
+       * tests/base.at (AC_CACHE_CHECK): Enhance test.
+       * doc/autoconf.texi (Site Defaults): Mention that CONFIG_SITE
+       works best as an absolute path.
+       * NEWS: Document the semantic change.
+
 2010-03-13  Bruno Haible  <address@hidden>
        and Ralf Wildenhues  <address@hidden>
 
diff --git a/NEWS b/NEWS
index 5c0d130..3e1155c 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,9 @@ GNU Autoconf NEWS - User visible changes.
    and `--with-*' arguments, converting them to underscores for the variable
    names.
 
+** In configure scripts, loading CONFIG_SITE no longer searches PATH,
+   and problems in loading the configuration site files are diagnosed.
+
 * Major changes in Autoconf 2.65 (2009-11-21) [stable]
   Released by Eric Blake, based on git versions 2.64.*.
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 519158c..42469db 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -20980,7 +20980,8 @@ site- and system-wide initialization files.
 
 @evindex CONFIG_SITE
 If the environment variable @code{CONFIG_SITE} is set, @command{configure}
-uses its value as the name of a shell script to read.  Otherwise, it
+uses its value as the name of a shell script to read; it is recommended
+that this be an absolute file name.  Otherwise, it
 reads the shell script @address@hidden/share/config.site} if it exists,
 then @address@hidden/etc/config.site} if it exists.  Thus,
 settings in machine-specific files override those in machine-independent
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index e764b16..cadec67 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1870,7 +1870,12 @@ m4_define([AC_SITE_LOAD],
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in @%:@((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -1884,7 +1889,8 @@ do
   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
     AC_MSG_NOTICE([loading site script $ac_site_file])
     sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || AC_MSG_FAILURE([failed to load site script $ac_site_file])
   fi
 done
 ])
diff --git a/tests/base.at b/tests/base.at
index 54ccd8a..8f6e30f 100644
--- a/tests/base.at
+++ b/tests/base.at
@@ -258,6 +258,7 @@ AT_CLEANUP
 # Also make sure we warn about cache id's not named with `_cv_'.
 
 AT_SETUP([AC_CACHE_CHECK])
+AT_KEYWORDS([CONFIG_SITE])
 
 # Don't let a config.site file affect this test.
 AS_UNSET([CONFIG_SITE])
@@ -395,13 +396,14 @@ AT_CHECK([grep cache stdout], [1])
 AT_CHECK([LC_ALL=C ls -t config.cache a-stamp-file | sed 1q | grep 
config.cache], [1])
 
 # config.site can specify a site-wide cache, accumulating information.
-AT_DATA([config.site],
+# Also test that we don't run afoul of sourcing a file with leading -.
+AT_DATA([-config.site],
 [[cache_file=sitecache
 ]])
 AT_DATA([sitecache],
 [[my_cv_some_preset_cache_var=yes
 ]])
-CONFIG_SITE=config.site
+CONFIG_SITE=-config.site
 export CONFIG_SITE
 AT_CHECK_CONFIGURE
 AT_CHECK([grep my_cv_some_preset_cache_var sitecache], [], [ignore])
@@ -409,6 +411,18 @@ AT_CHECK([grep my_cv_shell_true_works sitecache], [], 
[ignore])
 AT_CHECK_CONFIGURE([], [], [stdout])
 AT_CHECK([grep 'whether true.*works.*cached' stdout], [], [ignore])
 
+# Check that config cache scripts must be well-formed.
+AT_DATA([bad.site],
+[[fi
+]])
+CONFIG_SITE=$PWD/bad.site
+AT_CHECK_CONFIGURE([], [1], [ignore], [stderr])
+AT_CHECK([grep 'failed to load site script' stderr], [], [ignore])
+
+# However, a missing file is ignored.
+CONFIG_SITE=./no-such-file
+AT_CHECK_CONFIGURE
+
 AT_CLEANUP
 
 


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

[Prev in Thread] Current Thread [Next in Thread]