Replace "rm -rf" and "rm -fr" with "rm -f -r", as POSIX requires.

This commit is contained in:
Paul Eggert 2004-01-05 07:05:22 +00:00
parent f95cc1efe7
commit 12475c8947
11 changed files with 50 additions and 26 deletions

View File

@ -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

View 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 && \

View 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)) &&\

View 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}

View 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=' '

View 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

View 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,

View 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

View 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
}

View 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)

View 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