]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Replace "rm -rf" and "rm -fr" with "rm -f -r", as POSIX requires.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 Jan 2004 07:05:22 +0000 (07:05 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 Jan 2004 07:05:22 +0000 (07:05 +0000)
ChangeLog
Makefile.am
Makefile.maint
doc/autoconf.texi
lib/autoconf/general.m4
lib/autoconf/libs.m4
lib/autoconf/specific.m4
lib/autotest/general.m4
lib/m4sugar/m4sh.m4
tests/Makefile.am
tests/torture.at

index f5d162be554377830148f8c6c150df2866c0ecdf..1ffe8ab5266ff0e829fc323d06211af720d7becd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,21 @@
        Bug reported by David Relson in
        <http://mail.gnu.org/archive/html/autoconf/2004-01/msg00011.html>.
 
+       * Makefile.am (autom4te-update):
+       Replace "rm -rf" and "rm -fr" with "rm -f -r", as POSIX requires.
+       * Makefile.maint (my-distcheck, do-po-update): Likewise.
+       * doc/autoconf.texi (Guidelines): Likewise.
+       * lib/autoconf/general.m4 (_AC_INIT_PREPARE): Likewise.
+       * lib/autoconf/libs.m4 (_AC_PATH_X_XMKMF): Likewise.
+       * lib/autoconf/specific.m4 (AC_SYS_LONG_FILE_NAMES): Likewise.
+       * lib/autotest/general.m4 (AT_INIT): Likewise.
+       * lib/m4sugar/m4sh.m4 (AS_TMPDIR): Likewise.
+       * tests/Makefile.am (clean-local): Likewise.
+       * tests/tortue.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS,
+       srcdir): Likewise.
+       * doc/autoconf.texi (Limitations of Usual Tools):
+       Warn against "rm -fr".
+       
 2004-01-03  Paul Eggert  <eggert@twinsun.com>
 
        * doc/autoconf.texi (Limitations of Usual Tools): Mention that cc
index fb30c00e1f6274ee1658c64f731e2b73842d4fec..40da19f0b038d1aab2442b5c8d29c4320473ef77 100644 (file)
@@ -1,7 +1,9 @@
 ## Process this file with automake to create Makefile.in. -*-Makefile-*-
 
 ## Makefile for Autoconf.
-## Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+## Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -73,7 +75,7 @@ autom4te_files = \
   Autom4te/XFile.pm
 
 autom4te-update:
-       rm -rf Fetchdir > /dev/null 2>&1
+       rm -f -r Fetchdir > /dev/null 2>&1
        mkdir Fetchdir; mkdir Fetchdir/Autom4te
 ## If a get fails then that is a problem.
        (cd Fetchdir && \
index 376bc3eac2dffc1a46569ff2b478a50e020f6f29..d2b712bf8b41954ba7927e8b6f99ebff3c5930fb 100644 (file)
@@ -2,7 +2,7 @@
 # This Makefile fragment is shared between the coreutils,
 # CPPI, Bison, and Autoconf.
 
-## Copyright (C) 2001-2003 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -329,7 +329,7 @@ null_AM_MAKEFLAGS = \
 TMPDIR ?= /tmp
 t=$(TMPDIR)/$(PACKAGE)/test
 my-distcheck: $(local-check)
-       -rm -rf $(t)
+       -rm -f -r $(t)
        mkdir -p $(t)
        GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
        cd $(t)/$(distdir) \
@@ -342,7 +342,7 @@ my-distcheck: $(local-check)
        (cd $(t) && mv $(distdir) $(distdir).old \
          && $(AMTAR) -zxf - ) < $(distdir).tar.gz
        diff -ur $(t)/$(distdir).old $(t)/$(distdir)
-       -rm -rf $(t)
+       -rm -f -r $(t)
        @echo "========================"; \
        echo "$(distdir).tar.gz is ready for distribution"; \
        echo "========================"
@@ -418,7 +418,7 @@ po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
 .PHONY: do-po-update po-update
 do-po-update:
        tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
-       rm -rf $$tmppo && \
+       rm -f -r $$tmppo && \
        mkdir $$tmppo && \
        (cd $$tmppo && \
          $(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
index 819e89472462a52ab76a71fa3251fc6201df8638..8d825d9abac5205a6a4ab17f5e30b72aecbfd6f0 100644 (file)
@@ -6363,7 +6363,7 @@ example, if you call @code{AC_HEADER_STDC}, then later on in
 
 If a test program needs to use or create a data file, give it a name
 that starts with @file{conftest}, such as @file{conftest.data}.  The
-@command{configure} script cleans up by running @samp{rm -rf conftest*}
+@command{configure} script cleans up by running @samp{rm -f -r conftest*}
 after running test programs and if the script is interrupted.
 
 @node Test Functions
@@ -11277,6 +11277,13 @@ exec > foo
 rm -f foo
 @end example
 
+@item @command{rm}
+@c ---------------
+@prindex @command{rm}
+Avoid @samp{rm -fr}; instead, use @samp{rm -f -r}.  @acronym{POSIX} says
+that scripts must not combine options into a single argument when
+invoking a standard utility like @command{rm}.
+
 @item @command{sed}
 @c ----------------
 @prindex @command{sed}
index e39922a3dfe9ccd23d253ff44855cae5d6902628..77096c790e8e577931cb2746a7180d30565f1889 100644 (file)
@@ -1192,7 +1192,7 @@ trap 'exit_status=$?
     echo "$as_me: exit $exit_status"
   } >&AS_MESSAGE_LOG_FD
   rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$[$]* $ac_clean_files &&
+  rm -f -r conftest* confdefs* conf$[$]* $ac_clean_files &&
     exit $exit_status
      ' 0
 for ac_signal in 1 2 13 15; do
@@ -1201,7 +1201,7 @@ done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
+rm -f -r conftest* confdefs.h
 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
 # NextStep 3.3 (patch 3) loses unless the first echo outputs at least 14 bytes.
 ac_space=' '
index d43027dc9b45ab6dcac9c8b0cd912c265d3fef02..9992f4d1b0afff85be99b404555398e4f3e310a7 100644 (file)
@@ -1,7 +1,7 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Checking for libraries.
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002 Free Software Foundation, Inc.
+# 2002, 2003, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -180,7 +180,7 @@ m4_popdef([AC_Lib_Name])dnl
 # Internal subroutine of _AC_PATH_X.
 # Set ac_x_includes and/or ac_x_libraries.
 m4_define([_AC_PATH_X_XMKMF],
-[rm -fr conftest.dir
+[rm -f -r conftest.dir
 if mkdir conftest.dir; then
   cd conftest.dir
   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
@@ -211,7 +211,7 @@ _ACEOF
     esac
   fi
   cd ..
-  rm -fr conftest.dir
+  rm -f -r conftest.dir
 fi
 ])# _AC_PATH_X_XMKMF
 
index 45ad1d3d4b3c76a32f5520a1b0ff553295b341fe..c5e605ac594c15bd1face6a26cfb41c70cdffe41 100644 (file)
@@ -2,7 +2,7 @@
 # Macros that test for specific, unclassified, features.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003 Free Software Foundation, Inc.
+# 2002, 2003, 2004 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -234,10 +234,10 @@ for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
   ac_val=`cat $ac_tf1 2>/dev/null`
   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
     ac_cv_sys_long_file_names=no
-    rm -rf $ac_xdir 2>/dev/null
+    rm -f -r $ac_xdir 2>/dev/null
     break
   fi
-  rm -rf $ac_xdir 2>/dev/null
+  rm -f -r $ac_xdir 2>/dev/null
 done])
 if test $ac_cv_sys_long_file_names = yes; then
   AC_DEFINE(HAVE_LONG_FILE_NAMES, 1,
index 19e07059b89f561e7c0bf06f686b70c9fba9ad36..6ab5eec144af18882cc2d418370dcecda3f6649c 100644 (file)
@@ -253,7 +253,7 @@ do
        ;;
 
     --clean | -c )
-       rm -rf $at_suite_dir $at_suite_log
+       rm -f -r $at_suite_dir $at_suite_log
        exit 0
        ;;
 
@@ -600,7 +600,7 @@ do
       # Create a fresh directory for the next test group, and enter.
       at_group_dir=$at_suite_dir/$at_group_normalized
       at_group_log=$at_group_dir/$as_me.log
-      rm -rf $at_group_dir
+      rm -f -r $at_group_dir
       mkdir $at_group_dir ||
        AS_ERROR([cannot create $at_group_dir])
       cd $at_group_dir
@@ -692,7 +692,7 @@ _ATEOF
          echo "$at_log_msg" >&AS_MESSAGE_LOG_FD
 
          # Cleanup the group directory, unless the user wants the files.
-         $at_debug_p || rm -rf $at_group_dir
+         $at_debug_p || rm -f -r $at_group_dir
          ;;
        *)
          # Upon failure, include the log into the testsuite's global
index bc6bab46d808a5ef4fd94af5d97959880d8fa020..cf93117eee0a95c8f8bf27416c21aef02eb5a11f 100644 (file)
@@ -1,7 +1,7 @@
 # This file is part of Autoconf.                          -*- Autoconf -*-
 # M4 sugar for common shell constructs.
 # Requires GNU M4 and M4sugar.
-# Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -896,7 +896,7 @@ m4_define([AS_TMPDIR],
 [# Create a temporary directory, and hook for its removal unless debugging.
 $debug ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap 'exit_status=$?; rm -f -r $tmp && exit $exit_status' 0
   trap 'AS_EXIT([1])' 1 2 13 15
 }
 
index cb7c0afd6dc72bb359c95e2e693b1c2b203f434d..eb62c3f9762cd01fc51203b920fe8c617c7554cf 100644 (file)
@@ -1,7 +1,7 @@
 ## Process this file with automake to create Makefile.in. -*-Makefile-*-
 
 ## Makefile for Autoconf testsuite.
-## Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+## Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -96,7 +96,7 @@ atconfig: $(top_builddir)/config.status
 clean-local:
        test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
        rm -f *.tmp
-       rm -rf autom4te.cache
+       rm -f -r autom4te.cache
 
 check-local: atconfig atlocal $(TESTSUITE)
        $(SHELL) $(TESTSUITE)
index bf61d7bbf029200c4cb86bbb5a5b1d40c93ce2c3..d8807de3219652add8fce4c9667c97ec520bd73c 100644 (file)
@@ -1,6 +1,6 @@
 #                                                      -*- Autotest -*-
 
-# Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -128,7 +128,7 @@ AT_SETUP([AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS])
 
 AT_DATA([configure.ac],
 [[AC_INIT
-rm -rf header var-header file var-file link var-link command var-command
+rm -f -r header var-header file var-file link var-link command var-command
 echo 'OK' >input
 
 # Be sure to also stress the associated INIT-CMDS.
@@ -481,7 +481,7 @@ AT_CLEANUP
 
 AT_SETUP([srcdir])
 
-rm -rf at-dir
+rm -f -r at-dir
 mkdir at-dir
 : >at-dir/bar.in
 : >foo.in
@@ -497,7 +497,7 @@ AC_CONFIG_COMMANDS([report],
                   [srcdir=$srcdir])
 
 AC_OUTPUT
-rm -rf foo at-dir/bar
+rm -f -r foo at-dir/bar
 ]])
 
 AT_CHECK_AUTOCONF