From user-return-48408-apmail-ant-user-archive=ant.apache.org@ant.apache.org Wed Feb 02 15:19:01 2005 Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 51963 invoked from network); 2 Feb 2005 15:19:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Feb 2005 15:19:01 -0000 Received: (qmail 45461 invoked by uid 500); 2 Feb 2005 15:18:53 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 45382 invoked by uid 500); 2 Feb 2005 15:18:52 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 45368 invoked by uid 99); 2 Feb 2005 15:18:52 -0000 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=MSGID_RANDY,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from smtpauth04.mail.atl.earthlink.net (HELO smtpauth04.mail.atl.earthlink.net) (209.86.89.64) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Feb 2005 07:18:51 -0800 Received: from [4.235.102.123] (helo=toshi2) by smtpauth04.mail.atl.earthlink.net with asmtp (Exim 4.34) id 1CwMHI-0006QC-B7 for user@ant.apache.org; Wed, 02 Feb 2005 10:18:49 -0500 Date: Wed, 02 Feb 2005 08:18:48 -0700 To: "Ant Users List" Subject: Re: manipulating property strings References: <20050131161752.24741.qmail@web30901.mail.mud.yahoo.com> From: "michael sorens" Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <20050131161752.24741.qmail@web30901.mail.mud.yahoo.com> User-Agent: Opera M2/7.54u1 (Win32, build 3918) X-Antivirus: avast! (VPS 0505-1, 02/02/2005), Outbound message X-Antivirus-Status: Clean X-ELNK-Trace: 4e0c1d090ab3975b710a60220b707070239a348a220c2609aa0d0a253f31cf9b5879cc13086d382e387f7b89c61deb1d350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 4.235.102.123 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N With the pointer to the , I was able to rewrite the task to avoid a temp file. However, that introduced a different problem. When I do this sequence (i.e. *with* a temp file): CASE 1: ... ... and there are NO errors (i.e. the filterchain that greps for error messages left errors.present unset), the fail is not executed. (This is the desired behavior.) However, when I do this (without a temp file): CASE 2: ... ... then the fail *is* executed even when there are NO error messages collected by the errorfilterchain. The problem, of course, is that the property is being set (albeit to an empty value) which, to ant, means it is true. So: any way to make CASE 2 behave like CASE 1? Or, failing that, is there anyway to examine a property with "higher" resolution, i.e. to notice that it has an empty string or a non-empty string? Here's a concrete example. As shown, two lines contain error messages, so the fail is executed showing those two lines. If you delete the "ERR" from both lines, the "fail" is still executed. line one ERR line two line three line ERR four On Mon, 31 Jan 2005 08:17:52 -0800 (PST), Matt Benson wrote: > --- michael sorens wrote: > >> Is there a way to manipulate the contents of a >> multi-line property string as if it were a file? >> Right now I collect stderr of an exec to a temp-file >> (error="filename") then read the temp-file and >> manipulate via filterchain, storing into a property, > [SNIP] >> ...then deleting the temp-file. >> >> I'm looking for a more elegant solution. > > Jan's example on redirector is not quite cut & paste > but it should give you the idea. If you can't get it > working after reading the manual and playing around > for a while let us know. > > Thanks, > Matt > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - Easier than ever with enhanced search. Learn more. > http://info.mail.yahoo.com/mail_250 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org