summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2013-07-20 05:55:22 +0000
committerarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2013-07-20 05:55:22 +0000
commitcac6b8720ac9cdb360d03d3c8e2fa721c1802050 (patch)
treed22c0fda6edb4a01e8b7767f09d8221f817e7bd4
parent63c0f55ee7e54ff2a52d908a55d23b562c557673 (diff)
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
-rw-r--r--tests/archive.pl15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/archive.pl b/tests/archive.pl
index 0de0945..0a03b23 100644
--- a/tests/archive.pl
+++ b/tests/archive.pl
@@ -17,6 +17,18 @@ for $source (sort {$a cmp $b} @sources)
my $meta = &readfile_meta($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)
{
my $path = $file;
@@ -31,9 +43,6 @@ for $source (sort {$a cmp $b} @sources)
}
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);
}
}