Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c3604a

Browse files
committed
Convert builddoc.bat into a perl script that actually works.
The old .bat file wasn't working for reasons that are unclear, andwhich it did not seem worth the trouble to ascertain.The new perl script has been tested and is known to work.Soon it will be tested regularly on the buildfarm.The .bat file is kept as a simple wrapper for the perl script.
1 parent0711a8b commit8c3604a

File tree

2 files changed

+126
-63
lines changed

2 files changed

+126
-63
lines changed

‎src/tools/msvc/builddoc.bat

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,7 @@
11
@echooff
2-
REM Adjust path for your docbook installation in buildenv.pl
32

43
REM src/tools/msvc/builddoc.bat
5-
6-
SETLOCAL
7-
SETSTARTDIR=%CD%
8-
SETOPENJADE=openjade-1.3.1
9-
SETDSSSL=docbook-dsssl-1.79
10-
11-
IFEXIST ..\msvcIFEXIST ..\..\..\srccd ..\..\..
12-
IFNOTEXIST doc\src\sgml\version.sgmlgoto noversion
13-
14-
IFNOTEXIST src\tools\msvc\buildenv.plgoto nobuildenv
15-
perl -e"require 'src/tools/msvc/buildenv.pl'; while(($k,$v) = each %ENV) { print qq[\@SET $k=$v\n]; }"> bldenv.bat
16-
CALL bldenv.bat
17-
del bldenv.bat
18-
:nobuildenv
19-
20-
IFNOTEXIST%DOCROOT%\%OPENJADE%SETNF=OpenJade
21-
IFNOTEXIST%DOCROOT%\docbookSETNF=docbook
22-
IFNOTEXIST%DOCROOT%\%DSSSL%setNF=docbook-dssl
23-
24-
IFNOT"%NF%"==""GOTO notfound
25-
26-
IF"%1"=="renamefiles"GOTO renamefiles
27-
28-
cmd /v /c src\tools\msvc\builddoc renamefiles
29-
cd doc\src\sgml
30-
31-
SETSGML_CATALOG_FILES=%DOCROOT%\%OPENJADE%\dsssl\catalog;%DOCROOT%\docbook\docbook.cat
32-
perl%DOCROOT%\%DSSSL%\bin\collateindex.pl -f -g -o bookindex.sgml -N
33-
perl mk_feature_tables.pl YES ..\..\..\src\backend\catalog\sql_feature_packages.txt ..\..\..\src\backend\catalog\sql_features.txt> features-supported.sgml
34-
perl mk_feature_tables.pl NO ..\..\..\src\backend\catalog\sql_feature_packages.txt ..\..\..\src\backend\catalog\sql_features.txt> features-unsupported.sgml
35-
perl make-errcodes-table.pl ..\..\..\src\backend\utils\errcodes.txt> errcodes-table.sgml
36-
37-
echo Running first build...
38-
%DOCROOT%\%OPENJADE%\bin\openjade -V draft-mode -wall -wno-unused-param -wno-empty -D . -c%DOCROOT%\%DSSSL%\catalog -d stylesheet.dsl -i output-html -t sgml postgres.sgml2>&1|findstr /V"DTDDECL catalog entries are not supported"
39-
echo Running collateindex...
40-
perl%DOCROOT%\%DSSSL%\bin\collateindex.pl -f -g -i bookindex -o bookindex.sgml HTML.index
41-
echo Running second build...
42-
%DOCROOT%\%OPENJADE%\bin\openjade -V draft-mode -wall -wno-unused-param -wno-empty -D . -c%DOCROOT%\%DSSSL%\catalog -d stylesheet.dsl -i output-html -t sgml postgres.sgml2>&1|findstr /V"DTDDECL catalog entries are not supported"
43-
44-
cd%STARTDIR%
45-
echo Docs build complete.
46-
exit /b
47-
48-
49-
:renamefiles
50-
REM Rename ISO entity files
51-
CD%DOCROOT%\docbook
52-
FOR%%fin (ISO*)do (
53-
setfoo=%%f
54-
IFNOT"!foo:~-4!"==".gml"ren!foo!!foo:~0,3!-!foo:~3!.gml
55-
)
56-
exit /b
57-
58-
:notfound
59-
echo Could not find directory for%NF%.
60-
cd%STARTDIR%
61-
goto :eof
62-
63-
:noversion
64-
echo Could not find version.sgml. Please run mkvcbuild.pl first!
65-
cd%STARTDIR%
66-
goto :eof
4+
REM all the logic for this now belongs in builddoc.pl. This file really
5+
REM only exists so you don't have to type "perl builddoc.pl"
6+
REM Resist any temptation to add any logic here.
7+
@perl builddoc.pl%*

‎src/tools/msvc/builddoc.pl

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# -*-perl-*- hey - emacs - this is a perl file
2+
3+
# Adjust path for your docbook installation in buildenv.pl
4+
5+
# src/tools/msvc/builddoc.pl
6+
# translated from an earlier .bat file
7+
8+
use strict;
9+
use File::Copy;
10+
use Cwdqw(abs_path getcwd);
11+
12+
13+
my$startdir = getcwd();
14+
15+
my$openjade ='openjade-1.3.1';
16+
my$dsssl ='docbook-dsssl-1.79';
17+
18+
chdir'../../..'if (-d'../msvc' &&-d'../../../src');
19+
20+
noversion()unless-e'doc/src/sgml/version.sgml';
21+
22+
require'src/tools/msvc/buildenv.pl'if-e'src/tools/msvc/buildenv.pl';
23+
24+
my$docroot =$ENV{DOCROOT};
25+
die"bad DOCROOT '$docroot'"unless ($docroot &&-d$docroot);
26+
27+
my@notfound;
28+
foreachmy$dir ('docbook',$openjade,$dsssl)
29+
{
30+
push(@notfound,$dir)unless-d"$docroot/$dir";
31+
}
32+
missing()if@notfound;
33+
34+
my$arg =shift;
35+
renamefiles();
36+
37+
38+
chdir'doc/src/sgml';
39+
40+
$ENV{SGML_CATALOG_FILES} ="$docroot/$openjade/dsssl/catalog;" .
41+
"$docroot/docbook/docbook.cat";
42+
43+
my$cmd;
44+
45+
# openjade exits below with a harmless non-zero status, so we
46+
# can't die on "failure"
47+
48+
$cmd =
49+
"perl mk_feature_tables.pl YES" .
50+
"../../../src/backend/catalog/sql_feature_packages.txt" .
51+
"../../../src/backend/catalog/sql_features.txt" .
52+
"> features-supported.sgml";
53+
system($cmd);die"features_supported"if$?;
54+
$cmd =
55+
"perl mk_feature_tables.pl NO" .
56+
"\"../../../src/backend/catalog/sql_feature_packages.txt\"" .
57+
"\"../../../src/backend/catalog/sql_features.txt\"" .
58+
"> features-unsupported.sgml";
59+
system($cmd);die"features_unsupported"if$?;
60+
$cmd =
61+
"perl generate-errcodes-table.pl\"../../../src/backend/utils/errcodes.txt\"" .
62+
"> errcodes-table.sgml";
63+
system($cmd);die"errcodes-table"if$?;
64+
65+
print"Running first build...\n";
66+
$cmd =
67+
"\"$docroot/$openjade/bin/openjade\" -V html-index -wall" .
68+
"-wno-unused-param -wno-empty -D . -c\"$docroot/$dsssl/catalog\"" .
69+
"-d stylesheet.dsl -i output-html -t sgml postgres.sgml 2>&1" .
70+
"| findstr /V\"DTDDECL catalog entries are not supported\"";
71+
system($cmd);# die "openjade" if $?;
72+
print"Running collateindex...\n";
73+
$cmd =
74+
"perl\"$docroot/$dsssl/bin/collateindex.pl\" -f -g -i bookindex" .
75+
"-o bookindex.sgml HTML.index";
76+
system($cmd);die"collateindex"if$?;
77+
mkdir"html";
78+
print"Running second build...\n";
79+
$cmd =
80+
"\"$docroot/$openjade/bin/openjade\" -wall -wno-unused-param -wno-empty" .
81+
"-D . -c\"$docroot/$dsssl/catalog\" -d stylesheet.dsl -t sgml" .
82+
"-i output-html -i include-index postgres.sgml 2>&1" .
83+
"| findstr /V\"DTDDECL catalog entries are not supported\"";
84+
85+
system($cmd);# die "openjade" if $?;
86+
87+
copy"stylesheet.css","html/stylesheet.css";
88+
89+
print"Docs build complete.\n";
90+
91+
exit;
92+
93+
########################################################
94+
95+
subrenamefiles
96+
{
97+
# Rename ISO entity files
98+
my$savedir = getcwd();
99+
chdir"$docroot/docbook";
100+
foreachmy$f (glob('ISO*'))
101+
{
102+
nextif$f =~/\.gml$/i;
103+
my$nf =$f;
104+
$nf =~s/ISO(.*)/ISO-$1.gml/;
105+
move$f,$nf;
106+
}
107+
chdir$savedir;
108+
109+
}
110+
111+
submissing
112+
{
113+
printSTDERR"could not find$docroot/$_\n"foreach (@notfound);
114+
exit 1;
115+
}
116+
117+
subnoversion
118+
{
119+
printSTDERR"Could not find version.sgml.",
120+
"Please run mkvcbuild.pl first!\n";
121+
exit 1;
122+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp