You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Eger, Patrick" <pe...@automotive.com> on 2009/03/24 02:36:53 UTC

Directory Sync

Hi, recently was working with some build scripts and found a deficiency
in the "Sync" task, namely that it cannot actually compare file content
and instead works strictly off file date. This was not usable for us and
so I implemented the attached task, that will sync two directory trees
based on file contents. I am submitting for inclusion in core or
contrib, or if you'd like to refactor and integrate into the existing
Sync task (I did not look at the code for Sync at all). LMK if any
questions, I'm not on the list so please CC me.

 

Regards, 

 

Patrick

 


Re: Directory Sync

Posted by Dominique Devienne <dd...@gmail.com>.
On Mon, Mar 23, 2009 at 8:36 PM, Eger, Patrick <pe...@automotive.com> wrote:
> Hi, recently was working with some build scripts and found a deficiency in
> the “Sync” task, namely that it cannot actually compare file content and
> instead works strictly off file date. This was not usable for us and so I
> implemented the attached task, that will sync two directory trees based on
> file contents. I am submitting for inclusion in core or contrib, or if you’d
> like to refactor and integrate into the existing Sync task (I did not look
> at the code for Sync at all). LMK if any questions, I’m not on the list so
> please CC me.

If you need to read both files to compare them, you might as well
delete the destination and copy the source, quite often this will be
faster. Unless you have some preserve in target that is.

And as Stefan mentions, it would have been much better to enhance sync
with a plugeable strategy for file comparison than starting from
scratch. Especially since the pieces are already in place very likely,
like by reusing the <different> selector. --DD

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


RE: Directory Sync

Posted by "Eger, Patrick" <pe...@automotive.com>.
> 
> Hi Patrick
> 
> On 2009-03-24, Eger, Patrick <pe...@automotive.com> wrote:
> 
> Unfortunately the mailing list manager has eaten your attachment.  The
> best approach is to open a bugzilla enhancement request and attach it
> there.

Done: https://issues.apache.org/bugzilla/show_bug.cgi?id=47010

> 
> > Hi, recently was working with some build scripts and found a
deficiency
> > in the "Sync" task, namely that it cannot actually compare file
content
> > and instead works strictly off file date.
> 
> I'm not sure how your implementation works, are you using arbitrary
> selectors or is it hard-coded to use content equality?
> 

Hard-coded, though possible integration with the Sync task would need to
have some way to select content-based comparison.

> > I am submitting for inclusion in core or contrib, or if you'd like
> > to refactor and integrate into the existing Sync task (I did not
> > look at the code for Sync at all). LMK if any questions, I'm not on
> > the list so please CC me.
> 
> Why did you chose to start from scratch instead of enhancing the
> existing task?  Just curious.

Mostly because I'm a complete moron and didn't even think of it :-) I'll
take a stab at Sync integration if I can find some spare time.

> 
> Stefan


Regards, 

Patrick

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


Re: Directory Sync

Posted by Stefan Bodewig <bo...@apache.org>.
Hi Patrick

On 2009-03-24, Eger, Patrick <pe...@automotive.com> wrote:

Unfortunately the mailing list manager has eaten your attachment.  The
best approach is to open a bugzilla enhancement request and attach it
there.

> Hi, recently was working with some build scripts and found a deficiency
> in the "Sync" task, namely that it cannot actually compare file content
> and instead works strictly off file date.

I'm not sure how your implementation works, are you using arbitrary
selectors or is it hard-coded to use content equality?

> I am submitting for inclusion in core or contrib, or if you'd like
> to refactor and integrate into the existing Sync task (I did not
> look at the code for Sync at all). LMK if any questions, I'm not on
> the list so please CC me.

Why did you chose to start from scratch instead of enhancing the
existing task?  Just curious.

Stefan

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