Code

enable failOnError in TaskDelete
authorishmal <ishmal@users.sourceforge.net>
Tue, 26 Aug 2008 14:02:46 +0000 (14:02 +0000)
committerishmal <ishmal@users.sourceforge.net>
Tue, 26 Aug 2008 14:02:46 +0000 (14:02 +0000)
buildtool.cpp

index a7d0876909b658e185fb7f07e483fa97aba3532e..23d265f02a6ebbfa5a81ecb39e1939008736d508 100644 (file)
@@ -7600,7 +7600,6 @@ public:
         bool verbose     = parent.evalBool(verboseOpt, false);
         bool quiet       = parent.evalBool(quietOpt, false);
         bool failOnError = parent.evalBool(failOnErrorOpt, true);
-        struct stat finfo;
         switch (delType)
             {
             case DEL_FILE:
@@ -7610,7 +7609,7 @@ public:
                 char *fname = (char *)fullName.c_str();
                 if (!quiet && verbose)
                     taskstatus("path: %s", fname);
-                if (!removeFile(fullName))
+                if (failOnError && !removeFile(fullName))
                     {
                     //error("Could not delete file '%s'", fullName.c_str());
                     return false;
@@ -7623,7 +7622,7 @@ public:
                 String fullDir = parent.resolve(dirName);
                 if (!quiet && verbose)
                     taskstatus("path: %s", fullDir.c_str());
-                if (!removeDirectory(fullDir))
+                if (failOnError && !removeDirectory(fullDir))
                     {
                     //error("Could not delete directory '%s'", fullDir.c_str());
                     return false;