diff --git a/doc/manual/.gitignore b/doc/manual/.gitignore index adcc78c6e4..df3a8c0f45 100644 --- a/doc/manual/.gitignore +++ b/doc/manual/.gitignore @@ -2,5 +2,4 @@ /version.py /substitutions.py /html -/team /conf_ref.rst diff --git a/doc/team/.gitignore b/doc/team/.gitignore new file mode 100644 index 0000000000..b692c0900a --- /dev/null +++ b/doc/team/.gitignore @@ -0,0 +1,6 @@ +_minted-team-manual/ +team-manual.aux +team-manual.log +team-manual.out +team-manual.pdf +gentexconfig diff --git a/doc/team/Makefile b/doc/team/Makefile index bd54ededeb..7c08960631 100644 --- a/doc/team/Makefile +++ b/doc/team/Makefile @@ -16,7 +16,7 @@ endif install-docs: $(INSTALL_PROG) -t $(DESTDIR)$(domjudge_docdir)/team \ - gentexconfig genteammanuals + gentexconfig genteammanual $(INSTALL_DATA) -t $(DESTDIR)$(domjudge_docdir)/team \ team-manual.tex team-manual.pdf $(INSTALL_DATA) -T README $(DESTDIR)$(domjudge_docdir)/README.teammanual @@ -25,8 +25,8 @@ gentexconfig: gentexconfig.in $(TOPDIR)/paths.mk $(substconfigvars) # 'genteammanual' (re-)generates all versions even if only one is not up-to-date. -$(MANUALSPDF): %pdf: %tex team-manual-preamble.tex $(TOPDIR)/etc/domserver-config.php - ./genteammanuals +$(MANUALSPDF): %pdf: %tex team-manual-preamble.tex + ./genteammanual # Cleanup LaTeX logs, etc. after generating documentation for distribution. distdocs-l: @@ -34,7 +34,7 @@ distdocs-l: clean-l: -rm -f $(addprefix team-manual.,aux log out) - -rm -rf _minted-team-manual* + -rm -rf _minted-team-manual distclean-l: -rm -f gentexconfig diff --git a/doc/team/genteammanuals b/doc/team/genteammanual similarity index 79% rename from doc/team/genteammanuals rename to doc/team/genteammanual index 7d5bcb6477..b33922cf34 100755 --- a/doc/team/genteammanuals +++ b/doc/team/genteammanual @@ -8,7 +8,7 @@ set -e -SOURCES="team-manual.tex team-manual-??.tex" +SOURCE=team-manual.tex PREAMBLE=team-manual-preamble.tex NRUNS=3 @@ -42,16 +42,13 @@ fi # Run LaTeX: # shellcheck disable=SC2059 { -for f in $SOURCES ; do - # Skip non-existing files due to unexpanded globbing: - [ -f "$f" ] || continue - [ "$QUIET" ] || printf "Running $NRUNS passes of '%s'..." "$LATEX $LATEXFLAGS $f" + [ "$QUIET" ] || printf "Running $NRUNS passes of '%s'..." "$LATEX $LATEXFLAGS $SOURCE" run=1 while [ "$run" -le "$NRUNS" ]; do # shellcheck disable=SC2086 - if ! ( cat "$TEXCONFIG" ; echo \\"input{$f}" ) | \ - $LATEX $LATEXFLAGS -jobname "${f%.tex}" -output-directory "$OUTPUTDIR" >/dev/null ; then - printf "\\nTeX-ing failed in run $run, see '%s' for details.\\n" "${f%tex}log$" + if ! ( cat "$TEXCONFIG" ; echo \\"input{$SOURCE}" ) | \ + $LATEX $LATEXFLAGS -jobname "${SOURCE%.tex}" -output-directory "$OUTPUTDIR" >/dev/null ; then + printf "\\nTeX-ing failed in run $run, see '%s' for details.\\n" "${SOURCE%tex}log" exit 1 else [ "$QUIET" ] || printf " $run" @@ -59,7 +56,6 @@ for f in $SOURCES ; do run=$((run+1)) done [ "$QUIET" ] || printf "\\n" ; -done } # end shellcheck disable rm -f "$TEXCONFIG" diff --git a/doc/team/gentexconfig.in b/doc/team/gentexconfig.in index 19e4c37336..1c67b53949 100755 --- a/doc/team/gentexconfig.in +++ b/doc/team/gentexconfig.in @@ -19,33 +19,20 @@ if (isset($_SERVER['REMOTE_ADDR'])) { $config = '@domserver_etcdir@/domserver-static.php'; // This script might be run before or after autoconf variable -// substitution, so we try to read the config from all possible -// places: +// substitution. if (is_readable($config)) { require($config); - require(ETCDIR . '/domserver-config.php'); - @include(ETCDIR . '/judgehost-config.php'); -} else { - @include('../../etc/domserver-config.php'); - @include('../../etc/judgehost-config.php'); - define( - 'DOMJUDGE_VERSION', - `grep -E 'DOMjudge.* version' ../../README.md | sed -n '1s/.*version //p' | tr -d '\n'` - ); } // FIXME: we need to read some of these variables from the MySQL DB. -$configvars = array( +$configvars = [ 'BASEURL' => 'https://example.com/domjudge/', 'DOMJUDGE_VERSION' => 'unknown', 'SOURCESIZE' => 256, 'COMPILETIME' => 30, - 'MEMLIMIT' => 524288, - 'FILELIMIT' => 4096, 'PROCLIMIT' => 15, - 'USERSUBMITDIR' => '.domjudge', 'SUBMITCLIENT_ENABLED' => 'yes', - ); + ]; foreach ($configvars as $var => $default) { $value = defined($var) ? constant($var) : $default;