summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Veller <tove@gentoo.org>2010-10-19 16:18:04 +0000
committerTorsten Veller <tove@gentoo.org>2010-10-19 16:18:04 +0000
commit5c6dcad3b737a3096008e0d3206a47de6d3051c9 (patch)
tree4510f45f65dc57a3240a808d32250e0c4cc249d0 /app-text/po4a/files
parentBump (diff)
downloadgentoo-2-5c6dcad3b737a3096008e0d3206a47de6d3051c9.tar.gz
gentoo-2-5c6dcad3b737a3096008e0d3206a47de6d3051c9.tar.bz2
gentoo-2-5c6dcad3b737a3096008e0d3206a47de6d3051c9.zip
Version bump (#338520). Tests work with gettext-0.18.1.1 (#341073)
(Portage version: 2.2_rc98/cvs/Linux x86_64)
Diffstat (limited to 'app-text/po4a/files')
-rw-r--r--app-text/po4a/files/compare-po.pl37
1 files changed, 37 insertions, 0 deletions
diff --git a/app-text/po4a/files/compare-po.pl b/app-text/po4a/files/compare-po.pl
new file mode 100644
index 000000000000..c01b9b8f31ee
--- /dev/null
+++ b/app-text/po4a/files/compare-po.pl
@@ -0,0 +1,37 @@
+#! /usr/bin/perl
+# Remove header entry of two PO files and compare them
+
+my $f1 = shift(@ARGV);
+my $f2 = shift(@ARGV);
+
+open IN1, "<", $f1 or die "Unable to read 1st file: $!\n";
+open IN2, "<", $f2 or die "Unable to read 2nd file: $!\n";
+my $inMsgstr = 0;
+my $lineno = 0;
+while (<IN1>) {
+ $lineno ++;
+ if (m/^msgstr/) {
+ $inMsgstr = 1;
+ } elsif ($inMsgstr == 1 && $_ !~ /^"/) {
+ last;
+ }
+}
+$inMsgstr = 0;
+while (<IN2>) {
+ if (m/^msgstr/) {
+ $inMsgstr = 1;
+ } elsif ($inMsgstr == 1 && $_ !~ /^"/) {
+ last;
+ }
+}
+
+# Now compare lines
+while (<IN1>) {
+ $lineno ++;
+ my $l2 = <IN2> or die "Unexpected EOF found when reading $f2\n";
+ $_ eq $l2 or die "Files $f1 and $f2 differ at line $lineno:\n-$_+$l2\n";
+}
+close IN1;
+die "EOF expected at 2nd file\n" unless eof(IN2);
+close IN2;
+exit 0;