On Monday 25 March 2002 21:23 pm, Mallampati, Suresh wrote: > I have two questions, one regarding source management, and the other > regarding ant in general. > > 1. Can we make CVS / Clearcase tasks accept filesets. > 2. Is there a way, I can do the following: > a. Iterate through a fileset
i've slated that as my next patch to the Cvs task, but i'm waiting until my other patches are approved/disapproved, so i can work from a clean piece of code. > b. For each file, check a condition > c. Perform a task on the file Checking a condition per-file... i can't imagine how that would be accomplished in Ant when using a fileset, at least not when using the existing Condition framework. > FOr ex: Given a src.dir fileset, if a file hasnt been added to source > control, or checked in, then add / check in the file.. That's asking quite a lot, actually. and none of it can be done 100% reliably by using only the Cvs tools unless, for example, you capture their output and look for phrases like "nothing known about foo.java". The only other alternative is checking against the existing CVS/Entries file, which is also not accurate because the file may have been added on another machine. For this last bit you're better off with something like this: find . -type d | xargs cvs add find . -type f | xargs cvs add find . -type f | xargs cvs ci -m 'initial checking' It may be possible using a Java-side Cvs library, but the only one i'm aware of can't be used by Ant because of licensing (at least, that's what the ant sources say). One of Cvs's problems is that it also doesn't give a non-0 error code on some commands which (IMO), should. For example, 'cvs status foo' does not fail if foo does not exist (it should, IMO), so the Java code has no way of knowing it failed (and if it failed, WHAT exactly failed?). ----- stephan Generic Unix Computer Guy [EMAIL PROTECTED] - http://www.einsurance.de Office: +49 (89) �552 92 862 Handy: �+49 (179) 211 97 67 "...control is a degree of inhibition, and a system which is perfectly inhibited is completely frozen." -- Alan W. Watts -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
