Francois Gouget : testbot/Engine: Use rmtree() instead of running 'rm -rf' .

Alexandre Julliard julliard at winehq.org
Mon May 5 14:42:12 CDT 2014


Module: tools
Branch: master
Commit: 9c38a40a2e870b92b0161d0268ce8512b2e29be1
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=9c38a40a2e870b92b0161d0268ce8512b2e29be1

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Fri May  2 19:51:19 2014 +0200

testbot/Engine: Use rmtree() instead of running 'rm -rf'.

---

 testbot/bin/Engine.pl |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index a12f263..f0570d7 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -40,7 +40,10 @@ use Fcntl;
 use MIME::Parser;
 use POSIX ":sys_wait_h";
 use Socket;
+use File::Path;
+
 use ObjectModel::BackEnd;
+
 use WineTestBot::Config;
 use WineTestBot::Engine::Events;
 use WineTestBot::Engine::Notify;
@@ -465,7 +468,11 @@ sub HandleWinePatchMLSubmission
   CreatePatches()->NewPatch($Entity);
 
   # Clean up
-  system("rm -rf $WorkDir");
+  if (!rmtree($WorkDir))
+  {
+    # Not a fatal error but log it to help diagnosis
+    LogMsg "Unable to delete '$WorkDir': $!\n";
+  }
   unlink($FullMessageFileName);
 
   return "1OK";
@@ -507,7 +514,11 @@ sub HandleWinePatchWebSubmission
   my $ErrMessage = CreatePatches()->NewPatch($Entity, $WebPatchId);
 
   # Clean up
-  system("rm -rf $WorkDir");
+  if (!rmtree($WorkDir))
+  {
+    # Not a fatal error but log it to help diagnosis
+    LogMsg "Unable to delete '$WorkDir': $!\n";
+  }
   unlink($FullFileName);
 
   return defined($ErrMessage) ? "0" . $ErrMessage : "1OK";




More information about the wine-cvs mailing list