You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Raman Gupta <ro...@fastmail.fm> on 2009/02/12 23:52:54 UTC

Generated ivy.xml line endings on windows

We have a project with mixed clients, linux and windows. Therefore we have a
policy of svn:eol-style LF on our XML checkins to keep everything
consistent.

The problem is that on publish IVY 2.0.0 on windows generates ivy.xml files
with mixed line feeds, and calculates the md5 and sha1 sums based on those
mixed line endings. Subversion of course modifies the line endings upon
checkin, with the immediate result of breaking the hashes in the repository.

I haven't looked at the code, but I suspect the behavior of the mixed line
feeds is most likely from an XML writer rather than IVY itself. Regardless,
shouldn't IVY regularize the line feeds before generating the sums? Perhaps
this could be an option on "deliver" to maintain the earlier behavior by
default.

If people agree, I can create an entry in the issue tracker for this.

Cheers,
Raman Gupta

-- 
View this message in context: http://www.nabble.com/Generated-ivy.xml-line-endings-on-windows-tp21986779p21986779.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: Generated ivy.xml line endings on windows

Posted by Raman Gupta <ro...@fastmail.fm>.

David Crossley wrote:
> 
> Raman Gupta wrote:
>> 
>> We have a project with mixed clients, linux and windows. Therefore we
>> have a
>> policy of svn:eol-style LF on our XML checkins to keep everything
>> consistent.
> 
> We do it differently:
> 
> 1) svn:eol-style native for all text files.
> 
> [...snip...]
> 

Thanks David. In fact, this is our exact policy for all text files except
for ivy*.xml. Why not ivy*.xml files? Because ivy*.xml files have md5 and/or
sha1 hashes associated with them by default. Since eol-style native checks
out files differently on windows and 'nix, the md5/sha1 sums are only
correct some of the time. Hence our decision to require eol-style LF for
ivy*.xml. However, as I described, even this does not work when the ivy file
is generated (via "deliver") on windows, since the md5/sha1 sums are
calculated based on inconsistent line endings. Our work-around for now is to
use svn:mime-type=application/octet-stream for ivy*.xml, which is silly, but
so far seems to work.

Cheers,
Raman

-- 
View this message in context: http://www.nabble.com/Generated-ivy.xml-line-endings-on-windows-tp21986779p21990592.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: Generated ivy.xml line endings on windows

Posted by David Crossley <cr...@apache.org>.
Raman Gupta wrote:
> 
> We have a project with mixed clients, linux and windows. Therefore we have a
> policy of svn:eol-style LF on our XML checkins to keep everything
> consistent.

We do it differently:

1) svn:eol-style native for all text files.

2) encourage all committers to configure their subversion clients.
e.g. http://www.apache.org/dev/version-control.html#https-svn-config

3) a committer on UNIX then does a sweep through the svn repo
to find line-endings problems and fixes any issues using dos2unix.
Also ensure eol-style settings. This needs to be done regularly
due to committers not configuring their svn client.

That ensures that source data is correct for the OS that is
generating the files.

I don't yet use Ivy so cannot comment, but i wonder if that
might be the cause.

-David

> The problem is that on publish IVY 2.0.0 on windows generates ivy.xml files
> with mixed line feeds, and calculates the md5 and sha1 sums based on those
> mixed line endings. Subversion of course modifies the line endings upon
> checkin, with the immediate result of breaking the hashes in the repository.
> 
> I haven't looked at the code, but I suspect the behavior of the mixed line
> feeds is most likely from an XML writer rather than IVY itself. Regardless,
> shouldn't IVY regularize the line feeds before generating the sums? Perhaps
> this could be an option on "deliver" to maintain the earlier behavior by
> default.
> 
> If people agree, I can create an entry in the issue tracker for this.
> 
> Cheers,
> Raman Gupta