ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 59379] New: Get task not quiet if dest file exists
Date Tue, 26 Apr 2016 17:14:49 GMT

            Bug ID: 59379
           Summary: Get task not quiet if dest file exists
           Product: Ant
           Version: 1.9.6
          Hardware: PC
                OS: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks

Created attachment 33806
Test case

# Overview

The Get task is not quiet when the `dest' file exists and the `quiet' and
`skipexisting' attributes are set to `true'; it displays a message like this:

[get] Destination already exists (skipping): /tmp/ant-get-test/mylib.jar

# Steps to Reproduce

1. Save the attached build.xml file to the directory /tmp/ant-get-test (or

2. Run Ant in the directory:

   $ ant

# Actual Results

Buildfile: /tmp/ant-get-test/build.xml

    [touch] Creating /tmp/ant-get-test/mylib.jar
      [get] Destination already exists (skipping): /tmp/ant-get-test/mylib.jar

Total time: 0 seconds

# Expected Results

The Get task should not write the message about the destination file already
existing because the `quiet' attribute is set to `true':

Buildfile: /tmp/ant-get-test/build.xml

    [touch] Creating /tmp/ant-get-test/mylib.jar

Total time: 0 seconds

# Build Date & Hardware

Ant 1.9.6 on OS X El Capitan (10.11.4).

# Additional Builds and Platforms

I haven't tested on other platforms, but the problem probably exists

# Additional Information

Looking at the source code for the Get task from the Git master branch, it
seems like one fix would be to only call the `log' method if the `quiet'
attribute is not set to `true' as in the attached get-quiet-skip-existing.diff

Another approach would be to change the `log(String, int)' method to use a
different conditional for the `msgLevel' test.  Right now, it uses `msgLevel >=
Project.MSG_ERR', but in Project, MSG_ERR, MSG_WARN, MSG_INFO, MSG_VERBOSE, and
MSG_DEBUG are set to 0-4, respectively, so the `msgLevel >= Project.MSG_ERR'
test will always evaluate to true (and hence the super.log call will always be
made) unless a value less than 0 is specified (i.e. not one of the Project
class constants).

You are receiving this mail because:
You are the assignee for the bug.

View raw message