From 4a0c2eff95ff8ecb1723ade258d89213d281aca5 Mon Sep 17 00:00:00 2001 From: Peter Karlsson Date: Fri, 19 Jul 2002 23:01:41 +0000 Subject: The -M option now will not mark Makefiles just containing an include line as different from the original. CVS version numbers check_trans.pl: 1.52 -> 1.53 --- check_trans.pl | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'check_trans.pl') diff --git a/check_trans.pl b/check_trans.pl index 4ab6fb8040d..6fb7b9a2749 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -143,7 +143,7 @@ my $altcvs = $cvs->new(); my $globtrans = Webwml::TransIgnore->new("."); # language configuration -my $defaultlanguage = 'italian'; +my $defaultlanguage = ''; if (exists $ENV{DWWW_LANG}) { $defaultlanguage = $ENV{DWWW_LANG}; @@ -159,6 +159,11 @@ my $from = 'english'; my $to = shift || $defaultlanguage; $to =~ s%/$%%; # Remove slash from the end +if ($to eq '') +{ + die "Language not defined in DWW_LANG, language.conf or on command line\n"; +} + my $langto = $to; $langto =~ s,^([^/]*).*$,$1,; if (-e "./$langto/international/$langto/current_status.pl" && @@ -262,9 +267,26 @@ if ($opt_M) { my $destination = $makefile; $destination =~ s/^$from/$to/o; if (-e $destination) { - STDOUT->flush; - system("diff -u $destination $makefile"); - STDOUT->flush; + # First check if the destination makefile simply includes the english + # version + my $includes = 0; + if (open MK, "<$destination") + { + my $firstline = ; + close MK; + $includes = 1 if $firstline =~ m'^include.*subst webwml/.*,webwml/english,.*CURDIR.*Makefile'; + } + else + { + warn "Cannot read $from: $!\n"; + } + unless ($includes) + { + # Otherwise show any differences + STDOUT->flush; + system("diff -u $destination $makefile"); + STDOUT->flush; + } } } } -- cgit v1.2.3