Make sure newlines are consistent for both .zip and .tar.gz archives
git-svn-id: http://pugixml.googlecode.com/svn/trunk@953 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
63c0f55ee7
commit
cac6b8720a
@ -17,6 +17,18 @@ for $source (sort {$a cmp $b} @sources)
|
|||||||
my $meta = &readfile_meta($source);
|
my $meta = &readfile_meta($source);
|
||||||
my $file = $basedir . $source;
|
my $file = $basedir . $source;
|
||||||
|
|
||||||
|
if (-T $source)
|
||||||
|
{
|
||||||
|
# convert all newlines to Unix format
|
||||||
|
$contents =~ s/\r//g;
|
||||||
|
|
||||||
|
if ($zip)
|
||||||
|
{
|
||||||
|
# convert all newlines to Windows format for .zip distribution
|
||||||
|
$contents =~ s/\n/\r\n/g;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($zip)
|
if ($zip)
|
||||||
{
|
{
|
||||||
my $path = $file;
|
my $path = $file;
|
||||||
@ -31,9 +43,6 @@ for $source (sort {$a cmp $b} @sources)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# tgz releases are for Unix people, Unix people like Unix newlines
|
|
||||||
$contents =~ s/\r//g if (-T $source);
|
|
||||||
|
|
||||||
$arch->add_data($file, $contents, $meta);
|
$arch->add_data($file, $contents, $meta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user