Skip to content

Commit 67e9079

Browse files
author
Release Manager
committed
gh-35950: `bootstrap`: Accept SPKG arguments <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> For a quick bootstrap of individual SPKGs. <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> Resolves #35867 (comment) <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35950 Reported by: Matthias Köppe Reviewer(s):
2 parents c7ca6b3 + e17b374 commit 67e9079

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

bootstrap

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,14 @@ SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])"
110110
echo 'changequote(>>>`<<<, >>>'"'"'<<<)dnl' >> $a
111111
done
112112

113-
for pkgname in $(sage-package list --has-file bootstrap); do
114-
(cd build/pkgs/$pkgname && ./bootstrap) || exit 1
113+
for pkgname in $(sage-package list --has-file bootstrap "$@"); do
114+
(cd build/pkgs/$pkgname && if [ -x bootstrap ]; then ./bootstrap; else echo >&2 "bootstrap:$LINENO: Nothing to do for $pkgname"; fi) || exit 1
115115
done
116116

117+
if [ $# != 0 ]; then
118+
return
119+
fi
120+
117121
# Default to no filter if "-q" was not passed.
118122
QUIET_SED_FILTER=""
119123
if [ "${BOOTSTRAP_QUIET}" = "yes" ]; then
@@ -126,7 +130,6 @@ SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])"
126130
# stdout alone. Basically we swap the two descriptors using a
127131
# third, filter, and then swap them back.
128132
./bootstrap-conda && \
129-
src/doc/bootstrap && \
130133
aclocal -I m4 && \
131134
automake --add-missing --copy build/make/Makefile-auto 3>&1 1>&2 2>&3 \
132135
| sed "${QUIET_SED_FILTER}" 3>&1 1>&2 2>&3 && \
@@ -236,7 +239,7 @@ save () {
236239

237240

238241
usage () {
239-
echo >&2 "Usage: $0 [-d|-D|-s] [-u <URL>] [-h] [-q]"
242+
echo >&2 "Usage: $0 [-d|-D|-s] [-u <URL>] [-h] [-q] [SPKG...]"
240243
echo >&2 ""
241244
echo >&2 "Options:"
242245
echo >&2 " -d fall back to downloading (released versions only)"
@@ -269,6 +272,7 @@ do
269272
?) usage; exit 2;;
270273
esac
271274
done
275+
shift $(($OPTIND - 1))
272276
export BOOTSTRAP_QUIET
273277
CONFBALL="upstream/configure-$CONFVERSION.tar.gz"
274278

@@ -278,14 +282,22 @@ if [ $DOWNLOAD$SAVE = yesyes ]; then
278282
exit 2
279283
fi
280284

281-
# Start cleanly (it's not a problem if this fails)
285+
if [ $# != 0 -a $DOWNLOAD$ALWAYSDOWNLOAD$SAVE != nonono ]; then
286+
echo >&2 "$0: Cannot combine -d, -D, -s, -u with SPKG arguments"
287+
usage
288+
exit 2
289+
fi
290+
291+
# Start cleanly when a full bootstrap is happening (it's not a problem if this fails)
282292
# POSIX supports two separate incompatible formats for the MAKEFLAGS
283293
# variable, so instead of guessing, we simply define our own variable
284294
# to optionally pass an "-s" (silent) flag to Make.
285-
MAKE_SILENT=""
286-
[ "${BOOTSTRAP_QUIET}" = "yes" ] && MAKE_SILENT="-s"
287-
$MAKE ${MAKE_SILENT} bootstrap-clean 2>/dev/null
288-
mkdir config 2>/dev/null
295+
if [ $# = 0 ]; then
296+
MAKE_SILENT=""
297+
[ "${BOOTSTRAP_QUIET}" = "yes" ] && MAKE_SILENT="-s"
298+
$MAKE ${MAKE_SILENT} bootstrap-clean 2>/dev/null
299+
fi
300+
mkdir -p config 2>/dev/null
289301

290302
if [ $ALWAYSDOWNLOAD = yes ]; then
291303
if [ -n "$CONFTARBALL_URL" ]; then
@@ -302,7 +314,7 @@ if [ $ALWAYSDOWNLOAD = yes ]; then
302314
bootstrap_download || exit $?
303315
fi
304316
else
305-
bootstrap
317+
bootstrap "$@"
306318
fi
307319

308320
if [ $SAVE = yes ]; then
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/bootstrap

build/pkgs/sagemath_doc_html/src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../src/doc

0 commit comments

Comments
 (0)