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
## 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
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 && \
# 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
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) \
(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 "========================"
.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)) &&\
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
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}
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
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=' '
# 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
# 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.
esac
fi
cd ..
- rm -fr conftest.dir
+ rm -f -r conftest.dir
fi
])# _AC_PATH_X_XMKMF
# 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
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,
;;
--clean | -c )
- rm -rf $at_suite_dir $at_suite_log
+ rm -f -r $at_suite_dir $at_suite_log
exit 0
;;
# 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
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
# 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
[# 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
}
## 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
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)
# -*- 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
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.
AT_SETUP([srcdir])
-rm -rf at-dir
+rm -f -r at-dir
mkdir at-dir
: >at-dir/bar.in
: >foo.in
[srcdir=$srcdir])
AC_OUTPUT
-rm -rf foo at-dir/bar
+rm -f -r foo at-dir/bar
]])
AT_CHECK_AUTOCONF