GNU bug report logs - #10828
POSIX will say running "rm -f" with no argument is OK

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: automake; Severity: wishlist; Reported by: Stefano Lattarini <stefano.lattarini@HIDDEN>; dated Thu, 16 Feb 2012 20:44:01 UTC; Maintainer for automake is bug-automake@HIDDEN.

Message received at 10828 <at> debbugs.gnu.org:


Received: (at 10828) by debbugs.gnu.org; 16 Jan 2013 12:14:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 16 07:14:06 2013
Received: from localhost ([127.0.0.1]:34653 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TvRsb-0007kZ-Ka
	for submit <at> debbugs.gnu.org; Wed, 16 Jan 2013 07:14:06 -0500
Received: from mail-lb0-f172.google.com ([209.85.217.172]:46979)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1TvRsX-0007k1-71
	for 10828 <at> debbugs.gnu.org; Wed, 16 Jan 2013 07:14:03 -0500
Received: by mail-lb0-f172.google.com with SMTP id y2so991875lbk.31
	for <10828 <at> debbugs.gnu.org>; Wed, 16 Jan 2013 04:13:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=x-received:message-id:date:from:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=GeHnyKSSqGMTqrJyPPBBwl7PgEP8CLVQcA1PSWu+OvM=;
	b=z5hOW5uxtuLW0sWJkLgsFeZgDJTykBufLhJk51GvWfXIS4PbRQBNDIxt/E4YSbPKMi
	UtH/8KDRbac+J8oHCEcs1e71ZBKNPcKRRKdA09fVKYF8SrsozrXZvGRxtTNMK2re9gk4
	zEvDi6D4R39N4ZebFogdRgqoqtcF+/qMttj+UO7UbN3c/NSdrqyjcP68/G0ewhA95jSw
	QSzWm04FW1F5bJeyt0C+pJNukX+QD7kuezBz02wlsz57dd1lLtakbBYpkNcoC6M58mzM
	WDucUjzuYvAKIxeRfgcw3boBDlCLsLQTIZY+6wNQ4Kiab6QyRS4KLuxmOaNCiLWrK6u/
	KJiQ==
X-Received: by 10.112.25.100 with SMTP id b4mr543518lbg.37.1358338402440;
	Wed, 16 Jan 2013 04:13:22 -0800 (PST)
Received: from [192.168.178.21]
	(host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137])
	by mx.google.com with ESMTPS id o2sm4141599lby.11.2013.01.16.04.13.20
	(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
	Wed, 16 Jan 2013 04:13:21 -0800 (PST)
Message-ID: <50F6995E.9010705@HIDDEN>
Date: Wed, 16 Jan 2013 13:13:18 +0100
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
MIME-Version: 1.0
To: automake-patches@HIDDEN
Subject: [PATCH] init.m4: add probe to check "rm -f" without args work
References: <4F3D69DF.6000602@HIDDEN>
	<5b666c49b48fdd80892070d4a208f6f7ae9b1d58.1357758733.git.stefano.lattarini@HIDDEN>
In-Reply-To: <5b666c49b48fdd80892070d4a208f6f7ae9b1d58.1357758733.git.stefano.lattarini@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.9 (/)
X-Debbugs-Envelope-To: 10828
Cc: 10828 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.9 (/)

On 01/09/2013 08:14 PM, Stefano Lattarini wrote:
> See automake bug#10828.
> 
> * PLANS/rm-f-without-args.txt: New.
> 
> Signed-off-by: Stefano Lattarini <stefano.lattarini@HIDDEN>
> ---
>  PLANS/rm-f-without-args.txt | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
>  create mode 100644 PLANS/rm-f-without-args.txt
> 
> diff --git a/PLANS/rm-f-without-args.txt b/PLANS/rm-f-without-args.txt
> new file mode 100644
> index 0000000..d5f96eb
> --- /dev/null
> +++ b/PLANS/rm-f-without-args.txt
> @@ -0,0 +1,40 @@
> +Summary
> +-------
> +
> +POSIX will say in a future version that calling "rm -f" with no argument
> +is OK; and this sensible behaviour seem to be already very widespread in
> +"the wild" (and possibly lacking only on those systems that are well on
> +their way to obsolescence).
> +
> +Se we'd like to simplify several automake-generated "cleaning" rules
> +accordingly, to get rid of the awful idiom:
> +
> +  test -z "$(VAR)" || rm -f $(VAR)
> +
> +See automake bug#10828.
> +
> +For Automake 1.13.2 (or 1.13.3)
> +-------------------------------
> +
> +Add a temporary "probe check" in AM_INIT_AUTOMAKE that verifies that
> +the no-args "rm -f" usage is supported on the system configure is
> +being run on; complain loudly (but not with a fatal error) if this is
> +not the case, and tell the user to report the situation to us.
> +
Here is a patch implementing this first part of the plan.  Note that, in
order to improve the visibility of the loud warning, I have made it fatal
by default; the user will still be able to instruct configure to continue
anyway by setting the ACCEPT_INFERIOR_RM_PROGRAM environment variable to
"yes" (that knob is mentioned in the fatal error message).

I will push in a couple of days if there is no objection.

Regards,
  Stefano

---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----

From f78b0f0b2741fcdd4e21151758a8a75ddaa8aa17 Mon Sep 17 00:00:00 2001
Message-Id: <f78b0f0b2741fcdd4e21151758a8a75ddaa8aa17.1358338329.git.stefano.lattarini@HIDDEN>
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
Date: Sat, 12 Jan 2013 19:20:54 +0100
Subject: [PATCH] init.m4: add probe to check "rm -f" without args work

See automake bug#10828.

POSIX will say in a future version that running "rm -f" with no argument
is OK: <http://austingroupbugs.net/view.php?id=542>).

We want to be able to make that assumption in our Makefile recipes.
So we introduce an aggressive probe to check that the usage we want is
actually supported "in the wild" to an acceptable degree.

* m4/init.m4 (AM_INIT_AUTOMAKE): Implement the probe.  To make any issue
more visible, cause the running configure to be aborted by default if
the 'rm' program in use doesn't match our expectations; the user can
still override this though, by setting the ACCEPT_INFERIOR_RM_PROGRAM
environment variable to "yes".

* t/spy-rm.tap: Update heading comments.
* t/rm-f-probe.sh: New test.
* t/list-of-tests.mk: Add it.
* PLANS/rm-f-without-args.txt: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@HIDDEN>
---
 PLANS/rm-f-without-args.txt |  8 ++---
 m4/init.m4                  | 43 +++++++++++++++++++++++++-
 t/list-of-tests.mk          |  1 +
 t/rm-f-probe.sh             | 74 +++++++++++++++++++++++++++++++++++++++++++++
 t/spy-rm.tap                |  8 ++---
 5 files changed, 125 insertions(+), 9 deletions(-)
 create mode 100755 t/rm-f-probe.sh

diff --git a/PLANS/rm-f-without-args.txt b/PLANS/rm-f-without-args.txt
index 5d39e22..5362f98 100644
--- a/PLANS/rm-f-without-args.txt
+++ b/PLANS/rm-f-without-args.txt
@@ -13,13 +13,13 @@ accordingly, to get rid of the awful idiom:

 See automake bug#10828.

-For Automake 1.13.2 (or 1.13.3)
--------------------------------
+For Automake 1.13.2 (DONE)
+--------------------------

 Add a temporary "probe check" in AM_INIT_AUTOMAKE that verifies that
 the no-args "rm -f" usage is supported on the system configure is
-being run on; complain loudly (but not with a fatal error) if this is
-not the case, and tell the user to report the situation to us.
+being run on; complain loudly if this is not the case, and tell the
+user to report the situation to us.

 For Automake 1.14
 -----------------
diff --git a/m4/init.m4 b/m4/init.m4
index c5af65c..ce64a6c 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -117,7 +117,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@HIDDEN about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi])

 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 44f598e..0f5dbee 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -953,6 +953,7 @@ t/remake-macrodir.sh \
 t/remake-timing-bug-pr8365.sh \
 t/reqd2.sh \
 t/repeated-options.sh \
+t/rm-f-probe.sh \
 t/rulepat.sh \
 t/self-check-cc-no-c-o.sh \
 t/self-check-configure-help.sh \
diff --git a/t/rm-f-probe.sh b/t/rm-f-probe.sh
new file mode 100755
index 0000000..1cb220a
--- /dev/null
+++ b/t/rm-f-probe.sh
@@ -0,0 +1,74 @@
+#! /bin/sh
+# Copyright (C) 2013 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Verify our probe that checks that "rm -f" doesn't complain if called
+# without file operands works as expected.  See automake bug#10828.
+
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+mkdir bin
+cat > bin/rm <<'END'
+#!/bin/sh
+set -e; set -u;
+PATH=$original_PATH; export PATH
+rm_opts=
+while test $# -gt 0; do
+  case $1 in
+    -*) rm_opts="$rm_opts $1";;
+     *) break;;
+  esac
+  shift
+done
+if test $# -eq 0; then
+  echo "Oops, fake rm called without arguments" >&2
+  exit 1
+else
+  exec rm $rm_opts "$@"
+fi
+END
+chmod a+x bin/rm
+
+original_PATH=$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
+export PATH original_PATH
+
+rm -f && exit 99 # Sanity check.
+
+./configure 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr >&2
+
+grep "'rm' program.* unable to run without file operands" stderr
+$FGREP "tell bug-automake@HIDDEN about your system" stderr
+$FGREP "install GNU coreutils" stderr
+$EGREP "(^| |')ACCEPT_INFERIOR_RM_PROGRAM($| |')" stderr
+
+ACCEPT_INFERIOR_RM_PROGRAM=yes; export ACCEPT_INFERIOR_RM_PROGRAM
+
+./configure
+$MAKE
+$MAKE distcheck
+
+# For the sake of our exit trap.
+PATH=$original_PATH; export PATH
+
+:
diff --git a/t/spy-rm.tap b/t/spy-rm.tap
index 29840ab..3b8dd2d 100755
--- a/t/spy-rm.tap
+++ b/t/spy-rm.tap
@@ -19,10 +19,10 @@
 # to hold on all non-museum systems, and will soon be mandated
 # by POSIX as well) in future version of automake, to simplify
 # automake-provided cleanup rules.
-# References:
-#  <http://lists.gnu.org/archive/html/bug-autoconf/2012-02/msg00002.html>
-#  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10819>
-#  <http://austingroupbugs.net/view.php?id=542>
+# See automake bug#10828.
+# Other references:
+# <http://lists.gnu.org/archive/html/bug-autoconf/2012-02/msg00002.html>
+# <http://austingroupbugs.net/view.php?id=542>

 am_create_testdir=empty
 . test-init.sh
-- 
1.8.1.rc3.192.g2d0029e




Information forwarded to bug-automake@HIDDEN:
bug#10828; Package automake. Full text available.

Message received at 10828 <at> debbugs.gnu.org:


Received: (at 10828) by debbugs.gnu.org; 9 Jan 2013 19:15:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 09 14:15:00 2013
Received: from localhost ([127.0.0.1]:59083 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Tt175-000108-GF
	for submit <at> debbugs.gnu.org; Wed, 09 Jan 2013 14:14:59 -0500
Received: from mail-we0-f181.google.com ([74.125.82.181]:57863)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Tt172-0000zr-98
	for 10828 <at> debbugs.gnu.org; Wed, 09 Jan 2013 14:14:57 -0500
Received: by mail-we0-f181.google.com with SMTP id t11so1218578wey.26
	for <10828 <at> debbugs.gnu.org>; Wed, 09 Jan 2013 11:14:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=x-received:from:to:cc:subject:date:message-id:x-mailer;
	bh=cNj1ahUT/I5CFCig2Yn6xrWCoWMmMri3oDUW8WLYWLY=;
	b=TawIUjgFm/f1SkP2rJOgh4RvAvbBrCkvH4vo1HDH1DRjsTtyGba+XJCDGBxNGzphQW
	VPjDM4ehbS2vVxJrWj771ah1scesG1eJRa0nlR4bUvFM8oZzEnun5HdkP3m2noo18Ov7
	8PhC7LuMHa+YWCYhavGycB1cjHnpGwCRJ/7CvRkv55GKmOfSLBIEBgi/9HMUnhNC4CiQ
	Shr+5HmgZzKlByamniiiHg2DJz6pip9aVrWy5aejNJAIfm9mXo1fTjX5MCLqD/lgfqVB
	qnjK77CnYC5SXQvBdfCMvq8TCaUnyXIXJY29aXC25ZjtIGo7Tb6CSDDFT9FGLwcIShDc
	C5Pg==
X-Received: by 10.180.20.198 with SMTP id p6mr5042688wie.19.1357758879189;
	Wed, 09 Jan 2013 11:14:39 -0800 (PST)
Received: from localhost.localdomain
	(host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137])
	by mx.google.com with ESMTPS id w5sm5132802wif.11.2013.01.09.11.14.37
	(version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
	Wed, 09 Jan 2013 11:14:38 -0800 (PST)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: automake-patches@HIDDEN
Subject: [FYI] plans: automake 1.14 is to assume "rm -f" with no args is OK
Date: Wed,  9 Jan 2013 20:14:29 +0100
Message-Id: <5b666c49b48fdd80892070d4a208f6f7ae9b1d58.1357758733.git.stefano.lattarini@HIDDEN>
X-Mailer: git-send-email 1.8.1.rc3.192.g2d0029e
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 10828
Cc: 10828 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

See automake bug#10828.

* PLANS/rm-f-without-args.txt: New.

Signed-off-by: Stefano Lattarini <stefano.lattarini@HIDDEN>
---
 PLANS/rm-f-without-args.txt | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 PLANS/rm-f-without-args.txt

diff --git a/PLANS/rm-f-without-args.txt b/PLANS/rm-f-without-args.txt
new file mode 100644
index 0000000..d5f96eb
--- /dev/null
+++ b/PLANS/rm-f-without-args.txt
@@ -0,0 +1,40 @@
+Summary
+-------
+
+POSIX will say in a future version that calling "rm -f" with no argument
+is OK; and this sensible behaviour seem to be already very widespread in
+"the wild" (and possibly lacking only on those systems that are well on
+their way to obsolescence).
+
+Se we'd like to simplify several automake-generated "cleaning" rules
+accordingly, to get rid of the awful idiom:
+
+  test -z "$(VAR)" || rm -f $(VAR)
+
+See automake bug#10828.
+
+For Automake 1.13.2 (or 1.13.3)
+-------------------------------
+
+Add a temporary "probe check" in AM_INIT_AUTOMAKE that verifies that
+the no-args "rm -f" usage is supported on the system configure is
+being run on; complain loudly (but not with a fatal error) if this is
+not the case, and tell the user to report the situation to us.
+
+For Automake 1.14
+-----------------
+
+Make any failure in the configure-time probe check introduced by the
+previous point fatal; and in case of failure, also suggest to the user
+to install an older version of GNU coreutils to work around the
+limitation of his system (this version should be old enough not to
+be bootstrapped with Automake 1.14, otherwise the user will face a
+bootstrapping catch-9).
+
+In all our recipes, start assuming "rm -f" with no argument is OK;
+simplify and de-uglify the recipes accordingly.
+
+For Automake 1.15
+-----------------
+
+Remove the runtime probe altogether.
-- 
1.8.1.rc3.192.g2d0029e





Information forwarded to bug-automake@HIDDEN:
bug#10828; Package automake. Full text available.

Message received at 10828 <at> debbugs.gnu.org:


Received: (at 10828) by debbugs.gnu.org; 3 Jan 2013 19:14:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 03 14:14:49 2013
Received: from localhost ([127.0.0.1]:41934 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TqqFc-0005Nd-6U
	for submit <at> debbugs.gnu.org; Thu, 03 Jan 2013 14:14:49 -0500
Received: from mail-bk0-f48.google.com ([209.85.214.48]:43436)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1TqqFZ-0005NT-HK
	for 10828 <at> debbugs.gnu.org; Thu, 03 Jan 2013 14:14:47 -0500
Received: by mail-bk0-f48.google.com with SMTP id jc3so6733042bkc.7
	for <10828 <at> debbugs.gnu.org>; Thu, 03 Jan 2013 11:14:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=x-received:message-id:date:from:mime-version:to:subject
	:content-type:content-transfer-encoding;
	bh=Al/MuhgxdAYOlO3ny8rTCqdd83IjHVIurfmHB6u9UCA=;
	b=pq+5ClAgxA+xHc/mm5GQHGco6Fo48Ho/tMFXZ6yNPXm4Q8l5F7dzNzdY8SQJN0SKs5
	fsFv196DjqJpzujmutehkfLJ6SV1tshPqjpRhdZt5eow2fhmrslhqKm9VEa3gWVqYzTF
	BKPsG5CSRDpEOm69spXVRgjwZv/dD4p962m0W1cwnPbycbpFn5he1nJy5SBR2kB/hfiB
	4XkX8qggW3z9YJdILRmVhbA+WqtXHqJS6/+Cal+meGrsx+a4C4faixl9iC5C0vwRDKhn
	fi95zwel4xhBBaZF1DbZQdqvQMSnMao2rj5SdY5mvQTgCg6YDEmiwSefJt94v+QxW71V
	+nDQ==
X-Received: by 10.204.9.139 with SMTP id l11mr24037401bkl.133.1357240482061;
	Thu, 03 Jan 2013 11:14:42 -0800 (PST)
Received: from [192.168.178.21]
	(host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137])
	by mx.google.com with ESMTPS id l17sm35009772bkw.12.2013.01.03.11.14.39
	(version=SSLv3 cipher=OTHER); Thu, 03 Jan 2013 11:14:41 -0800 (PST)
Message-ID: <50E5D89C.1020001@HIDDEN>
Date: Thu, 03 Jan 2013 20:14:36 +0100
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
MIME-Version: 1.0
To: 10828 <at> debbugs.gnu.org
Subject: [RFC] POSIX will say running "rm -f" with no argument is OK
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 10828
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.2 (-)

Reference:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10828>

[This is posted also to the automake list to ensure a wider audience.
 Discussion should continue exclusively on the bug-automake list]

OK, time to resurrect this thread.

To summarize, POSIX will say in a future version that running "rm -f"
with no argument is OK; and that usage seems today portable to all
systems that are well on their way to obsolescence.

So, in Automake 1.14, we might start to simplify several automake
generated "cleaning" rules accordingly, to get rid of the awful
idiom:

  test -z "$(VAR)" || rm -f $(VAR)

In your opinion, can this be done without further fuss, or should we
add a temporary "probe check" in AM_INIT_AUTOMAKE that verifies that
the no-args "rm -f" usage is supported on the system configure is
being run on?  (As for a testsuite probe, that is already present;
see tests 't/spy-rm.tap', already present in Automake 1.13).

Comments welcome (and if your answer is "we should add a probe
check", patches are even more welcome ;-)

Regards,
  Stefano




Information forwarded to bug-automake@HIDDEN:
bug#10828; Package automake. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Feb 2012 20:43:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 15:43:38 2012
Received: from localhost ([127.0.0.1]:42949 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Ry8Aw-0003UY-2r
	for submit <at> debbugs.gnu.org; Thu, 16 Feb 2012 15:43:37 -0500
Received: from eggs.gnu.org ([140.186.70.92]:37881)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Ry8Ar-0003UK-Mc
	for submit <at> debbugs.gnu.org; Thu, 16 Feb 2012 15:43:33 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Ry88v-0001NN-4K
	for submit <at> debbugs.gnu.org; Thu, 16 Feb 2012 15:41:34 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([140.186.70.17]:38670)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Ry88v-0001NJ-2r
	for submit <at> debbugs.gnu.org; Thu, 16 Feb 2012 15:41:29 -0500
Received: from eggs.gnu.org ([140.186.70.92]:46250)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Ry88p-0000vR-OW
	for bug-automake@HIDDEN; Thu, 16 Feb 2012 15:41:28 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Ry88l-0001KT-Tq
	for bug-automake@HIDDEN; Thu, 16 Feb 2012 15:41:23 -0500
Received: from mail-ey0-f169.google.com ([209.85.215.169]:45503)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>)
	id 1Ry88d-0001Hn-73; Thu, 16 Feb 2012 15:41:11 -0500
Received: by eaag11 with SMTP id g11so1166486eaa.0
	for <multiple recipients>; Thu, 16 Feb 2012 12:41:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:mime-version:to:cc:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=WWfCRbdLpLkKFWQt+csgVouiwXuVGBoB1+Je/xJZrqQ=;
	b=CtOawwPIKbrIHVVwMoMbtLUtN7Bb8EtgUYVbkEf78R45ePwQiEWjB9gHuADiTNB4m0
	+t1MpsCANwtRsw6wHJUXoO1skxkQnxe+dqFDmydpJzch0kUOoZUUOpFLBJuy0cnwspCi
	Fyw4CDIEPa7T5u7mi8OW/j8xkb7IG82Ci98bU=
Received: by 10.112.9.40 with SMTP id w8mr1510036lba.103.1329424869737;
	Thu, 16 Feb 2012 12:41:09 -0800 (PST)
Received: from [82.56.31.53]
	(host53-31-dynamic.56-82-r.retail.telecomitalia.it. [82.56.31.53])
	by mx.google.com with ESMTPS id od2sm7340288lab.11.2012.02.16.12.41.06
	(version=SSLv3 cipher=OTHER); Thu, 16 Feb 2012 12:41:08 -0800 (PST)
Message-ID: <4F3D69DF.6000602@HIDDEN>
Date: Thu, 16 Feb 2012 21:41:03 +0100
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
MIME-Version: 1.0
To: Philip Rowlands <phr+coreutils@HIDDEN>
Subject: POSIX will say running "rm -f" with no argument is OK
References: <4F3BC9C7.3060204@HIDDEN>
	<4F3C2C4D.4060004@HIDDEN>	<E1RxwjV-00019S-FC@HIDDEN>
	<87pqdfqikf.fsf@HIDDEN>	<7856072A9D04C24B82DFE2B1112FE38A0D8E3EA35E@HIDDEN>	<878vk3qc1y.fsf@HIDDEN>
	<4F3D2095.3000105@HIDDEN> <4F3D4D41.3010202@HIDDEN>
	<4F3D51D5.8000107@HIDDEN> <4F3D55C2.6070900@HIDDEN>
In-Reply-To: <4F3D55C2.6070900@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
Cc: "10819 <at> debbugs.gnu.org" <10819 <at> debbugs.gnu.org>,
	"bug-autoconf@HIDDEN" <bug-autoconf@HIDDEN>,
	Jim Meyering <jim@HIDDEN>, Davide Brini <dave_br@HIDDEN>,
	bug-automake@HIDDEN, Eric Blake <eblake@HIDDEN>, "Voelker,
	Bernhard" <bernhard.voelker@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.4 (---)

Severity: wishlist

[CC:ing bug-automake, so that we won't forget about this issue]

Reference:
  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10819#40>

POSIX will say in a future version that running "rm -f" with no argument is OK;
we might simplify several automake-generated "cleaning" rules accordingly, to
get rid of the awful idiom:

  test -z "$(VAR)" || rm -f $(VAR)

On 02/16/2012 08:15 PM, Philip Rowlands wrote:
> On 16/02/2012 18:58, Eric Blake wrote:
> 
>>> so that we could simplify a bunch of automake recipes); but a more extensive
>>> probing is needed in this matter I guess.  And if you are right (as I hope),
>>> then this 'rm' feature could be documented in the Autoconf manual.
>>
>> Yep, I think that's appropriate, as it is unlikely that we will come up
>> with any counterexamples any time soon.
> 
> As the now-POSIX-infringing behaviour is simple to detect, couldn't automake detect
> it early and die with a helpful message, or is that contrary to its philosophy?
>
Well, that might be an overkill, since it appears that all the non-museum
implementations of 'rm' have the behaviour we want.  But I agree that, in case
we ever stumble upon a system violating this new expectation, adding proper
configure-time probing and warning might be helpful (and might convince the
users of such an inferior system to start using GNU coreutils).

Regards,
  Stefano




Acknowledgement sent to Stefano Lattarini <stefano.lattarini@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-automake@HIDDEN. Full text available.
Report forwarded to bug-automake@HIDDEN:
bug#10828; Package automake. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.