diff options
author | Peter Karlsson <peterk> | 2002-07-19 23:01:41 +0000 |
---|---|---|
committer | Peter Karlsson <peterk> | 2002-07-19 23:01:41 +0000 |
commit | 4a0c2eff95ff8ecb1723ade258d89213d281aca5 (patch) | |
tree | bf57cab3d9c7084e5c32542a72498f1d5eebbca6 /check_trans.pl | |
parent | a8b392667e7bc8fb20b4af2f5ee38ec328beca9c (diff) |
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
Diffstat (limited to 'check_trans.pl')
-rwxr-xr-x | check_trans.pl | 30 |
1 files changed, 26 insertions, 4 deletions
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 = <MK>; + 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; + } } } } |