Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 47362 invoked from network); 12 Oct 2009 20:15:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Oct 2009 20:15:01 -0000 Received: (qmail 95118 invoked by uid 500); 12 Oct 2009 20:15:01 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 95068 invoked by uid 500); 12 Oct 2009 20:15:00 -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 95059 invoked by uid 99); 12 Oct 2009 20:15:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 20:15:00 +0000 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 20:14:58 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id E280F234C1F0; Mon, 12 Oct 2009 13:14:37 -0700 (PDT) From: bugzilla@apache.org To: notifications@ant.apache.org Subject: DO NOT REPLY [Bug 47984] New: Ant's regexp mapper expects that the regex matches the whole input string, and munges file names if it doesn't match X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ant X-Bugzilla-Component: Core tasks X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: fgaliegue@gmail.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: notifications@ant.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 12 Oct 2009 13:14:37 -0700 (PDT) https://issues.apache.org/bugzilla/show_bug.cgi?id=47984 Summary: Ant's regexp mapper expects that the regex matches the whole input string, and munges file names if it doesn't match Product: Ant Version: 1.7.1 Platform: PC OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: Core tasks AssignedTo: notifications@ant.apache.org ReportedBy: fgaliegue@gmail.com This is using the default regex engine. Example build file demonstrating the problem: ---- build@build ~ $ cat build.xml ---- Say that t.txt doesn't exist. On the first run, it is created. So far, so good. But on the second run, the copy is _also_ executed, and that is totally unexpected. This has been verified with ant 1.6.5 and ant 1.7.1. If I run ant -v, here's what I see in the output: --- check: [uptodate] t.xml added as txt doesn't exist. ---- Two bugs here: * the regex /xml$/ didn't match t.xml, it should have matched; * the resulting file name is garbled: at the very least, the mapper should have left it untouched. A simple sed command returns the expected result: ---- fg@erwin ~ $ echo t.xml | sed 's,xml$,txt,' t.txt ---- This is especially frustrating since the documentation says: ---- If the source file name matches the from pattern, the target file name will be constructed from the to pattern ---- And /xml$/ DOES match t.xml. Nothing has ever said that regexes had to match their whole input! -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.