1. Add .sgml -> .revinc rule in web.mk. This tells how to make SGML include file which contains revision information. 2. Add ja/revcheck script. This script makes revision information from English SGML file and localized one. 3. Add *.revinc files into GENDOCS in localized Makefile. This will generate *.revinc files from each *.sgml files. 4. Add %rev.diff entity into localized includes.sgml. 5. Add statement to include *.revinc for each *.sgml files. (this will be followed separately.) Reviewed and not objected by: Doc Team
57 lines
1.4 KiB
Perl
Executable file
57 lines
1.4 KiB
Perl
Executable file
#!/usr/bin/perl -w
|
|
#
|
|
# The FreeBSD Japanese Documentation Project
|
|
#
|
|
# usage: revcheck <build topdir> <relative to localtop> <SGML filename>
|
|
#
|
|
# $FreeBSD$
|
|
|
|
my $buildtop = $ARGV[0];
|
|
my $reldir = $ARGV[1];
|
|
my $name_ja = $ARGV[2];
|
|
my $dir_en = $buildtop . "/en/" . $reldir;
|
|
my $name_en = $dir_en . "/" . $name_ja;
|
|
my $rev_en;
|
|
my $rev_ja;
|
|
my $basename = $name_ja;
|
|
|
|
$basename =~ s/\.sgml//;
|
|
|
|
### File exist?
|
|
die "Cannot read local file: $!\n"
|
|
unless -r $name_ja;
|
|
die "Cannot read English file: $!\n"
|
|
unless -r $name_en;
|
|
|
|
### Open English file.
|
|
open EN, $name_en or die "Cannot open English file: $!\n";
|
|
while (<EN>) {
|
|
if (/\$FreeBSD: .* (.*) .* .* .* .* \$/) {
|
|
$rev_en = $1;
|
|
last;
|
|
}
|
|
}
|
|
close EN;
|
|
|
|
### Open Localized file.
|
|
open JA, $name_ja or die "Cannot open localized file: $!\n";
|
|
while (<JA>) {
|
|
if (/Original [Rr]evision:[ \t]*([0-9.]+)/) {
|
|
$rev_ja = $1;
|
|
last;
|
|
}
|
|
}
|
|
close JA;
|
|
|
|
#print ".if \${REV_NAME} == $name_ja\n";
|
|
# print ".if \${.IMPSRC} == $name_ja\n";
|
|
# print "LATEST_EN_REV= $rev_en\n";
|
|
# print "CURRENT_BASE_REV= $rev_ja\n";
|
|
# print ".endif\n";
|
|
print "<!ENTITY buildtop '$buildtop'>\n";
|
|
print "<!ENTITY reldir '$reldir'>\n";
|
|
print "<!ENTITY dir.en '$dir_en'>\n";
|
|
print "<!ENTITY basename '$basename'>\n";
|
|
print "<!ENTITY rev.base '$rev_ja'>\n";
|
|
print "<!ENTITY rev.latest '$rev_en'>\n";
|
|
printf "<!ENTITY %% rev.diff '%s'>\n", ($rev_ja eq $rev_en) ? "IGNORE" : "INCLUDE";
|