Skip to content

Commit 84c3e36

Browse files
author
Matthias Koeppe
committed
build/bin/sage-spkg-info: Fix and improve RST markup
1 parent 93a900c commit 84c3e36

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

build/bin/sage-spkg-info

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@
77
PKG_BASE=$1
88
if [ -n "$OUTPUT_DIR" ]; then
99
exec > "$OUTPUT_DIR"/$PKG_BASE.rst
10+
fi
11+
if [ -n "$OUTPUT_RST" ]; then
1012
echo ".. _spkg_$PKG_BASE:"
1113
echo
14+
ref () { echo ":ref:\`$1\`"; }
15+
issue () { echo ":issue:\`$1\`"; }
16+
code () { echo "\`\`$*\`\`"; }
17+
else
18+
ref () { echo "$1"; }
19+
issue () { echo "https://github.com/sagemath/sage/issues/$1"; }
20+
code () { echo "$1"; }
1221
fi
1322
PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE"
1423
for ext in rst txt; do
@@ -45,9 +54,9 @@ for dep_file in dependencies dependencies_order_only; do
4554
# Dependencies like $(BLAS)
4655
\$\(*) echo "- $dep";;
4756
# Looks like a package
48-
*) if [ -n "$OUTPUT_RST" -a -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then
57+
*) if [ -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then
4958
# This RST label is set in src/doc/bootstrap
50-
echo "- :ref:\`spkg_$dep\`"
59+
echo "- $(ref spkg_$dep)"
5160
else
5261
echo "- $dep"
5362
fi;;
@@ -120,15 +129,15 @@ else
120129
if [ -f "${SPKG_CONFIGURE}" ]; then
121130
if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}"; then
122131
echo "If the system package is installed and if the (experimental) option"
123-
echo "--enable-system-site-packages is passed to ./configure, then ./configure"
132+
echo "$(code --enable-system-site-packages) is passed to $(code ./configure), then $(code ./configure)"
124133
echo "will check if the system package can be used."
125134
else
126-
echo "If the system package is installed, ./configure will check if it can be used."
135+
echo "If the system package is installed, $(code ./configure) will check if it can be used."
127136
fi
128137
else
129138
echo "However, these system packages will not be used for building Sage"
130-
echo "because spkg-configure.m4 has not been written for this package;"
131-
echo "see https://github.com/sagemath/sage/issues/27330"
139+
echo "because $(code spkg-configure.m4) has not been written for this package;"
140+
echo "see $(issue 27330)"
132141
fi
133142
fi
134143
echo

0 commit comments

Comments
 (0)