Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 53609 invoked from network); 23 Sep 2002 20:29:47 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 23 Sep 2002 20:29:47 -0000 Received: (qmail 16688 invoked by uid 97); 23 Sep 2002 20:29:59 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 16572 invoked by uid 97); 23 Sep 2002 20:29:58 -0000 Mailing-List: contact ant-user-help@jakarta.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 ant-user@jakarta.apache.org Received: (qmail 16519 invoked by uid 98); 23 Sep 2002 20:29:57 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: From: Dominique Devienne To: "'Ant Users List'" , Jacob Kjome Subject: RE: Re[2]: reverse glob mapper pattern? Date: Mon, 23 Sep 2002 15:29:15 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I agree it's bad, but it's even worse, since as Stefan pointed out, 'includes' is comma *and* space separated, so the current approach can potentially fail if the relative pathname (stripped of its prefix by ) contains any spaces in it!!! I'm still surprised the selectors cannot select the files Jacob wants to delete, but instead of going all this way around (with a flawed method at that), the easiest thing would be for Jacob to write his own selector. Something like (not tested): public class IsSampleCopySelector extends BaseSelector { ... public boolean isSelected(File basedir, String filename, File file) { File parent = file.getParent(); String name = file.getName(); File sampleFile = new File(parent, "sample."+name); return sampleFile.exists() && sampleFile.isFile(); } } As far as campaigning for my weekend hacking to add a nested to all Task-deriving tasks: I'm not planning on wasting my breath on a lost cause... --DD -----Original Message----- From: Diane Holt [mailto:holtdl@yahoo.com] Sent: Monday, September 23, 2002 2:59 PM To: Ant Users List; Jacob Kjome Subject: Re: Re[2]: reverse glob mapper pattern? --- Jacob Kjome wrote: > However, now I have a problem that if this is run and > no * files exist, the "includes" attribute on the filesets inside > ends up being empty like includes="". When that happens, the > fileset selects *all* files as part of the fileset so the entire > project is deleted except for the default excludes. That is extremely > bad! You'll need to break out the into a separate target, have it depend on the 'ing/'ing target, then 'if' on the property that you'd be passing to 'includes' so that the target that does the delete only runs if the property gets set. Of course, if all tasks supported if/unless, you could just add an 'if' to the -- unfortunately that's not available just yet (hint,hint to DD to campaign for his patch :) Diane -- To unsubscribe, e-mail: For additional commands, e-mail: