Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC9B619F05 for ; Tue, 26 Apr 2016 17:14:50 +0000 (UTC) Received: (qmail 38074 invoked by uid 500); 26 Apr 2016 17:14:50 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 38031 invoked by uid 500); 26 Apr 2016 17:14:50 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 38022 invoked by uid 99); 26 Apr 2016 17:14:50 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2016 17:14:50 +0000 Received: from asf-bz1-us-mid.priv.apache.org (nat1-us-mid.apache.org [23.253.172.122]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPS id A16E51A0117 for ; Tue, 26 Apr 2016 17:14:50 +0000 (UTC) Received: by asf-bz1-us-mid.priv.apache.org (ASF Mail Server at asf-bz1-us-mid.priv.apache.org, from userid 33) id 6A20D60D0C; Tue, 26 Apr 2016 17:14:49 +0000 (UTC) From: bugzilla@apache.org To: notifications@ant.apache.org Subject: [Bug 59379] New: Get task not quiet if dest file exists Date: Tue, 26 Apr 2016 17:14:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ant X-Bugzilla-Component: Core tasks X-Bugzilla-Version: 1.9.6 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jlmuir@imca-cat.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: notifications@ant.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bz.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 https://bz.apache.org/bugzilla/show_bug.cgi?id=59379 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 Assignee: notifications@ant.apache.org Reporter: jlmuir@imca-cat.org Created attachment 33806 --> https://bz.apache.org/bugzilla/attachment.cgi?id=33806&action=edit 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 wherever) 2. Run Ant in the directory: $ ant # Actual Results Buildfile: /tmp/ant-get-test/build.xml build: [touch] Creating /tmp/ant-get-test/mylib.jar [get] Destination already exists (skipping): /tmp/ant-get-test/mylib.jar BUILD SUCCESSFUL 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 build: [touch] Creating /tmp/ant-get-test/mylib.jar BUILD SUCCESSFUL 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 everywhere. # 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 (untested). 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.