]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/Autom4te/General.pm (END): Use `File::Path::rmtree' to
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Aug 2006 21:21:19 +0000 (21:21 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Aug 2006 21:21:19 +0000 (21:21 +0000)
simplify the code.

ChangeLog
lib/Autom4te/General.pm

index bff7eb43106bdb1c7f16b87b39662b49ccc657a9..a2584808475372a5228089e0ca14673f3bf8fcd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-25  Noah Misch  <address@hidden>
+
+       * lib/Autom4te/General.pm (END): Use `File::Path::rmtree' to
+       simplify the code.
+
 2006-08-25  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix Lex library problem reported to us by Julio Garvia.
index d06f4d5a12b0a2569f08185c8f11f77e98293a4a..3a137344020cfa53063a8a87dba8b84df6901644 100644 (file)
@@ -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