File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
# Build translated docs
3
- # Expects input 'html' or 'latex', defaults to 'html'.
3
+ # Expects input like 'html' and 'latex', defaults to 'html'.
4
4
#
5
5
# SPDX-License-Identifier: CC0-1.0
6
6
7
7
set -xeu
8
8
9
- format=" $1 "
10
-
11
- if [ -z " $format " ]; then
9
+ if [ -z " $1 " ]; then
12
10
format=html
13
- elif [ ! " $format " = html ] && [ ! " $format " = latex ]; then
14
- echo " Invalid format. Expected html or latex"
15
- exit 1
11
+ else
12
+ format=" $1 "
16
13
fi
17
14
18
15
# Fail earlier if required variables are not set
@@ -24,7 +21,7 @@ mkdir -p logs
24
21
# If version is 3.12 or older, set gettext_compact.
25
22
# This confval is not needed since 3.12.
26
23
# In 3.13, its presence messes 3.13's syntax checking (?)
27
- opts=" -D language=${PYDOC_LANGUAGE} --keep-going -w ../../logs/sphinxwarnings.txt"
24
+ opts=" -D language=${PYDOC_LANGUAGE} --keep-going -w ../../logs/sphinxwarnings- ${format} .txt"
28
25
minor_version=$( git -C cpython/Doc branch --show-current | sed ' s|^3\.||' )
29
26
if [ $minor_version -lt 12 ]; then
30
27
opts=" $opts -D gettext_compact=False"
33
30
make -C cpython/Doc " ${format} " SPHINXOPTS=" ${opts} "
34
31
35
32
# Remove empty file
36
- if [ ! -s logs/sphinxwarnings.txt ]; then
37
- rm logs/sphinxwarnings.txt
33
+ if [ ! -s " logs/sphinxwarnings- ${format} .txt" ]; then
34
+ rm " logs/sphinxwarnings- ${format} .txt"
38
35
fi
You can’t perform that action at this time.
0 commit comments