Skip to content

Commit 68b07f6

Browse files
authored
adjust log name and remove format check
1 parent 54ae797 commit 68b07f6

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

scripts/build.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
#!/bin/sh
22
# Build translated docs
3-
# Expects input 'html' or 'latex', defaults to 'html'.
3+
# Expects input like 'html' and 'latex', defaults to 'html'.
44
#
55
# SPDX-License-Identifier: CC0-1.0
66

77
set -xeu
88

9-
format="$1"
10-
11-
if [ -z "$format" ]; then
9+
if [ -z "$1" ]; then
1210
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"
1613
fi
1714

1815
# Fail earlier if required variables are not set
@@ -24,7 +21,7 @@ mkdir -p logs
2421
# If version is 3.12 or older, set gettext_compact.
2522
# This confval is not needed since 3.12.
2623
# 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"
2825
minor_version=$(git -C cpython/Doc branch --show-current | sed 's|^3\.||')
2926
if [ $minor_version -lt 12 ]; then
3027
opts="$opts -D gettext_compact=False"
@@ -33,6 +30,6 @@ fi
3330
make -C cpython/Doc "${format}" SPHINXOPTS="${opts}"
3431

3532
# 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"
3835
fi

0 commit comments

Comments
 (0)