ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52106] delete task is loud even when politely asked to be quiet
Date Fri, 28 Oct 2011 10:01:17 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52106

--- Comment #1 from Stefan Bodewig <bodewig@apache.org> 2011-10-28 10:01:17 UTC ---
This is tricky.

When deleting a directory tree Ant explicitly logs a "normal" level message for
the top level dir and verbose affects the individual files and directories
inside the tree.  When you use a single file arg this is considered the same as
the top-level of the tree.

The fix is simple

Index: src/main/org/apache/tools/ant/taskdefs/Delete.java
===================================================================
--- src/main/org/apache/tools/ant/taskdefs/Delete.java  (revision 1190217)
+++ src/main/org/apache/tools/ant/taskdefs/Delete.java  (working copy)
@@ -551,7 +551,8 @@
                         + " cannot be removed using the file attribute.  "
                         + "Use dir instead.", quiet ? Project.MSG_VERBOSE :
ver
bosity);
                 } else {
-                    log("Deleting: " + file.getAbsolutePath());
+                    log("Deleting: " + file.getAbsolutePath(),
+                        quiet ? Project.MSG_VERBOSE : verbosity);

                     if (!delete(file)) {
                         handle("Unable to delete file " +
file.getAbsolutePath());

but would make the logging logic of that task (even more) inconsistent.

You get the behavior you want by using a nested <file> resource rather than the
file attribute.

<delete quiet="true">
  <file file="${wrapper-log-path}" />
</delete>

Did I say logging already was inconsistent?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message