From: Paul Eggert Date: Fri, 25 Aug 2006 21:21:19 +0000 (+0000) Subject: * lib/Autom4te/General.pm (END): Use `File::Path::rmtree' to X-Git-Tag: AUTOCONF-2.60a~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c6fa73a54afe55521268aeee79c0d708c6f7562;p=thirdparty%2Fautoconf.git * lib/Autom4te/General.pm (END): Use `File::Path::rmtree' to simplify the code. --- diff --git a/ChangeLog b/ChangeLog index bff7eb431..a25848084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-08-25 Noah Misch + + * lib/Autom4te/General.pm (END): Use `File::Path::rmtree' to + simplify the code. + 2006-08-25 Paul Eggert Fix Lex library problem reported to us by Julio Garvia. diff --git a/lib/Autom4te/General.pm b/lib/Autom4te/General.pm index d06f4d5a1..3a1373440 100644 --- a/lib/Autom4te/General.pm +++ b/lib/Autom4te/General.pm @@ -1,5 +1,5 @@ # autoconf -- create `configure' using m4 macros -# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2004, 2006 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 @@ -38,6 +38,7 @@ use Exporter; use Autom4te::ChannelDefs; use Autom4te::Channels; use File::Basename; +use File::Path (); use File::stat; use IO::File; use Carp; @@ -191,24 +192,8 @@ sub END if (!$debug && defined $tmp && -d $tmp) { - if (<$tmp/*>) - { - while (<$tmp/*>) - { - if (! unlink $_) - { - print STDERR "$me: cannot empty $tmp ($_): $!\n"; - $? = 1; - return; - } - } - } - if (! rmdir $tmp) - { - print STDERR "$me: cannot remove $tmp: $!\n"; - $? = 1; - return; - } + local $SIG{__WARN__} = sub { $status = 1; warn $_[0] }; + File::Path::rmtree $tmp; } # This is required if the code might send any output to stdout