You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nicolas Mailhot <Ni...@laPoste.net> on 2004/07/08 14:24:14 UTC

File list/Dir list problem

Hi,

	I'm currently stuck in ant trying to perform the following operation:

1. I have a lot of separate file trees that are ultimately merged by
being copied under a single root

2. The individual trees are not totally independent: they are grouped
into separate sets

3. I need to keep track of the file/dir contributions of each set to the
end result, ie generate a text file per set listing all the files and
directories in the final root that were contributed by this set.

I more or less managed to generate the file lists but I'm stuck on the
dir list part (you can't concatenate dir lists like file lists since a
file is unique but a dir can be shared by several files). If anyone here
has a bright idea, I'll be eternally grateful.

(of course I can cheat by piping the file lists into a shell script, but
that won't be overly popular with people working on limited systems)

Regards,

-- 
Nicolas Mailhot

Re: File list/Dir list problem

Posted by Nicolas Mailhot <Ni...@laPoste.net>.
Le jeu, 08/07/2004 à 17:22 +0200, Stefan Bodewig a écrit :
> On Thu, 08 Jul 2004, Nicolas Mailhot <Ni...@laposte.net>
> wrote:
> 
> > Won't ant remember the dirsets have different roots and consider
> > root1/a and root2/a to be different ?
> 
> Uhm, yes.  The path contains the absolute paths.
> 
> What list is it that you need in the end?
> 
> A list of all directories that have contributed, no matter what the
> root has been?  This could come from your final copy target.

The list of all directories that have contributed that have been
contributed by the roots in a given set:(.

Since the final copy is not set-aware I can't work on its results. All
roots are mingled regardless of what set they belong to (in fact one of
the things the file lists are used to is to untangle the result later
on).

BTW on second thought something that removed duplicate lines in a file
would probably be sufficient to solve the dir problem. ie dump the dir
names in several files, strip the different roots, concatenate the
result and remove duplicates.

(or even take file list - remove the part that follows the / on each
line, then remove duplicates. Probably easier since I already have the
file lists and I know there is not a single directory inside)

However this supposes ant is capable of removing duplicate lines in a
text file. Can it do it ?

Regards,

-- 
Nicolas Mailhot

Re: File list/Dir list problem

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 08 Jul 2004, Nicolas Mailhot <Ni...@laposte.net>
wrote:

> Won't ant remember the dirsets have different roots and consider
> root1/a and root2/a to be different ?

Uhm, yes.  The path contains the absolute paths.

What list is it that you need in the end?

A list of all directories that have contributed, no matter what the
root has been?  This could come from your final copy target.

A list of all directories per root directory?  There shouldn't be any
duplicates then.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: File list/Dir list problem

Posted by Nicolas Mailhot <Ni...@laPoste.net>.
Le jeu, 08/07/2004 à 17:05 +0200, Stefan Bodewig a écrit :
> On Thu, 08 Jul 2004, Nicolas Mailhot <Ni...@laposte.net>
> wrote:
> 
> > I thought about it - the problem of course is unicity.  Is there a
> > way in ant to take a text file list and remove duplicates ?
> 
> The dirsets shouldn't contain duplicates.  Uhm, I see, you have
> duplicates via separates dirsets.

Yep

> Put all <dirset>s into a single <path>?  This should remove the
> duplicates.

Won't ant remember the dirsets have different roots and consider root1/a
and root2/a to be different ?

Regards,

-- 
Nicolas Mailhot

Re: File list/Dir list problem

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 08 Jul 2004, Nicolas Mailhot <Ni...@laposte.net>
wrote:

> I thought about it - the problem of course is unicity.  Is there a
> way in ant to take a text file list and remove duplicates ?

The dirsets shouldn't contain duplicates.  Uhm, I see, you have
duplicates via separates dirsets.

Put all <dirset>s into a single <path>?  This should remove the
duplicates.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: File list/Dir list problem

Posted by Nicolas Mailhot <Ni...@laPoste.net>.
Le jeu, 08/07/2004 à 16:51 +0200, Stefan Bodewig a écrit :
> On Thu, 08 Jul 2004, Nicolas Mailhot <Ni...@laposte.net>
> wrote:
> 
> > I more or less managed to generate the file lists but I'm stuck on
> > the dir list part
> 
> It should work the same way you do it for your file list, just usind
> <dirset> nested into the path you pass to pathconvert.

I thought about it - the problem of course is unicity.
Is there a way in ant to take a text file list and remove duplicates ?

Cheers,

-- 
Nicolas Mailhot

Re: File list/Dir list problem

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 08 Jul 2004, Nicolas Mailhot <Ni...@laposte.net>
wrote:

> I more or less managed to generate the file lists but I'm stuck on
> the dir list part

It should work the same way you do it for your file list, just usind
<dirset> nested into the path you pass to pathconvert.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org