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.61a-366


From: Ralf Wildenhues
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.61a-366-g7559c93
Date: Sun, 02 Mar 2008 12:08:40 +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=7559c93d382040bcc6818f668485f34eeb75ceef

The branch, master has been updated
       via  7559c93d382040bcc6818f668485f34eeb75ceef (commit)
      from  2abed75dde56a57de82794fb97fc71f2275c0af5 (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 7559c93d382040bcc6818f668485f34eeb75ceef
Author: Benoit Sigoure <address@hidden>
Date:   Tue Dec 18 13:54:08 2007 +0100

    Be nice with file systems that don't handle unusual characters.
    
        * tests/atlocal.in (func_sanitize_file_name)
        (func_sanitize_dir_name): New shell functions.
        * tests/tools.at (autom4te and whitespace in file names)
        (autotools and whitespace in file names): Use them.
        * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
        Cover more potentially problemtic file names.  Use the new
        functions.
    
    Signed-off-by: Benoit Sigoure <address@hidden>
    Signed-off-by: Ralf Wildenhues <address@hidden>

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

Summary of changes:
 ChangeLog        |    9 +++++++++
 tests/atlocal.in |   26 ++++++++++++++++++++++++++
 tests/tools.at   |    9 ++++-----
 tests/torture.at |   42 +++++++++++++++++++++++++-----------------
 4 files changed, 64 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c480adf..b247fd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2008-03-01  Benoit Sigoure  <address@hidden>
 
+       Be nice with file systems that don't handle unusual characters.
+       * tests/atlocal.in (func_sanitize_file_name)
+       (func_sanitize_dir_name): New shell functions.
+       * tests/tools.at (autom4te and whitespace in file names)
+       (autotools and whitespace in file names): Use them.
+       * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
+       Cover more potentially problemtic file names.  Use the new
+       functions.
+
        Properly handle funny file names for headers in config.status.
        The test suite did not cover this bug because the code was not
        quoting properly the arguments of `rm -f' (which "fails" silently)
diff --git a/tests/atlocal.in b/tests/atlocal.in
index dad0ea8..bc7a914 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -24,3 +24,29 @@ SED='@SED@'
 
 # We need to know if sh -n is ok.
 ac_cv_sh_n_works='@ac_cv_sh_n_works@'
+
+# Check whether the underlying system can manage some unusual
+# symbols in file names.
+unsupported_fs_chars=
+for c in '\\' '"' '<' '>' '*' '?' '|'
+do
+  touch "t$c" 2>/dev/null
+  test -f "t$c" && rm -f "t$c" && continue
+  # $c cannot be used in a file name.
+  unsupported_fs_chars=$unsupported_fs_chars$c
+done
+if test -z "$unsupported_fs_chars"; then
+  func_sanitize_file_name () { echo "$@"; }
+else
+  func_sanitize_file_name () { echo "$@" | tr -d "$unsupported_fs_chars"; }
+fi
+
+# Can we create directories with trailing whitespaces in their name?
+rm -rf 'tdir /'
+mkdir 'tdir ' && touch 'tdir /tfile' 2>/dev/null
+if test -f 'tdir /tfile'; then
+  func_sanitize_dir_name () { echo "$@"; }
+  rm -rf 'tdir /'
+else
+  func_sanitize_dir_name () { echo "$@" | sed 's/  *$//'; }
+fi
diff --git a/tests/tools.at b/tests/tools.at
index e5f9ae8..1b3dca5 100644
--- a/tests/tools.at
+++ b/tests/tools.at
@@ -146,15 +146,14 @@ AT_SETUP([autom4te and whitespace in file names])
 x=
 export x
 rm -f a b
-# the first one omits special characters and trailing spaces,
-# which are not w32 safe.
 for funny in \
   'with  funny '\'' $x & #! name' \
   'with  funny \ '\'' \'\'' " <a >b * ? name ' # "restore font-lock
 do
+  funny=`func_sanitize_file_name "$funny"`
   file=" file $funny"
   outfile="$file out "
-  dir=" dir $funny"
+  dir=`func_sanitize_dir_name " dir $funny"`
   cachedir=" cache$dir"
   TMPDIR=" tmp$dir"
   export TMPDIR
@@ -988,13 +987,13 @@ AT_SETUP([autotools and whitespace in file names])
 x=
 export x
 rm -f a b
-# the first one omits special characters that are not w32 safe.
 for funny in \
   'with  funny '\'' $x & #! name ' \
   'with  funny \ '\'' \'\'' " <a >b * ? name '
 do
+  funny=`func_sanitize_file_name "$funny"`
   file=" file $funny"
-  dir=" dir $funny"
+  dir=`func_sanitize_dir_name " dir $funny"`
   TMPDIR=" tmp$dir"
   export TMPDIR
 
diff --git a/tests/torture.at b/tests/torture.at
index c052c04..0eaea17 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -262,29 +262,37 @@ AT_CHECK_CONFIG_CREATION_NOWRITE(link)
 AT_CHECK([grep ac_write_fail config.status], [1])
 
 # Check that --file and --header accept funny file names
-file='file with  funny \ '\'' \'\'' $ & #!*? name'
-cat >"$file.in" <<'END'
+
+x=
+export x
+for file in \
+  'with  funny '\'' $x & #! name' \
+  'file with  funny \ '\'' \'\'' $ & #!*? name' \
+  'with  funny \ '\'' \'\'' " <a >b & * ? name ' # "restore font-lock
+do
+  # The function func_sanitize_file_name comes from tools.at
+  file=`func_sanitize_file_name "$file"`
+  cat >"$file.in" <<'END'
 OK
 END
-# skip if we cannot create such a file
-AT_CHECK([test -f "$file.in" || exit 77])
-AT_CHECK([./config.status "--file=$file:$file.in"],
-        [0], [ignore])
-AT_CHECK([grep OK "$file"], [], [OK
+  AT_CHECK([./config.status "--file=$file:$file.in"],
+          [0], [ignore])
+  AT_CHECK([grep OK "$file"], [], [OK
 ])
-AT_CHECK([./config.status "--header=$file:$file.in"],
-        [0], [ignore])
-# Run the same test a 2nd time to see that config.status does not recreate
-# the header (regression test)
-AT_CHECK([./config.status "--header=$file:$file.in"],
-        [0], [config.status: creating file with  funny \ ' \' $ & #!*? name
-config.status: file with  funny \ ' \' $ & #!*? name is unchanged
+  AT_CHECK([./config.status "--header=$file:$file.in"],
+          [0], [ignore])
+  # Run the same test a 2nd time to see that config.status does not recreate
+  # the header (regression test)
+  AT_CHECK_NOESCAPE([./config.status "--header=$file:$file.in"],
+                   [0], [config.status: creating $file
+config.status: $file is unchanged
 ])
-AT_CHECK([grep ' & ' "$file"], [],
-[/* file with  funny \ ' \' $ & #!*? name.  Generated from file with  funny \ 
' \' $ & #!*? name.in by configure.  */
+  AT_CHECK_NOESCAPE([grep ' & ' "$file"], [],
+[/* $file.  Generated from $file.in by configure.  */
 ])
-AT_CHECK([grep OK "$file"], [], [OK
+  AT_CHECK([grep OK "$file"], [], [OK
 ])
+done
 AT_CLEANUP
 
 


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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