>From 49cca731a596c9224281eb34114aeee6795dab10 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Stefano Lattarini Date: Wed, 11 Jan 2012 18:09:07 +0100 Subject: [PATCH 2/2] dist: avoid $(distdir) removal failure on MSYS/MinGW Fixes automake big#10470. * lib/am/distdir.am (am__remove_distdir): On MSYS (1.0.17) it is not possible to remove a directory that is in use; so, if rm fails, we sleep some seconds and retry, to give pending processes some time to exit and "release" the directory. * tests/Makefile.am (XFAIL_TESTS): Remove 'distcheck-pr10470.test'. Report and suggestions by Peter Rosin and Eric Blake. --- lib/am/distdir.am | 17 ++++++++++++----- tests/Makefile.am | 1 - 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/am/distdir.am b/lib/am/distdir.am index a681101..cd2e4bf 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -## 2010, 2011 Free Software Foundation, Inc. +## 2010, 2011, 2012 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 @@ -23,10 +23,17 @@ distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } - + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ +## On MSYS (1.0.17) it is not possible to remove a directory that is in +## use; so, if the first rm fails, we sleep some seconds and retry, to +## give pending processes some time to exit and "release" the directory +## before we remove it. The value of "some seconds" is 5 for the moment, +## which is mostly an arbitrary value, but seems high enough in practice. +## See automake bug#10470. + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi endif %?TOPDIR_P% if %?SUBDIRS% diff --git a/tests/Makefile.am b/tests/Makefile.am index e10dbd5..e79c3be 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,7 +23,6 @@ auxdir2.test \ cond17.test \ dist-auxfile.test \ dist-auxfile-2.test \ -distcheck-pr10470.test \ gcj6.test \ java-nobase.test \ objext-pr10128.test \ -- 1.7.7.3