/usr/share/sagemath/bin/sage-update-version is in sagemath-common 7.4-9.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #!/usr/bin/env bash
########################################################
# Update the Sage version
# To be called by the release manager
########################################################
CMD="${0##*/}"
die () {
echo >&2 -e "$@"
exit 1
}
usage () {
echo "usage: $CMD <SAGE_VERSION>"
}
if [ $# -ne 1 ]; then
usage
die
fi
if [ -z "$SAGE_ROOT" ]; then
die "must be run from within a Sage enviroment, or with SAGE_ROOT provided"
fi
if [ -z "$SAGE_SRC" ]; then
die "must be run from within a Sage enviroment, or with SAGE_SRC provided"
fi
set -e
# If $1 starts with "sage-", remove this prefix
SAGE_VERSION=`echo "$1" | sed 's/^sage-//'`
SAGE_RELEASE_DATE=`date -u +'%Y-%m-%d'`
# Update Sage version file for Python in SAGE_SRC/sage
cat <<EOF > "$SAGE_SRC/sage/version.py"
# Sage version information for Python scripts
# This file is auto-generated by the sage-update-version script, do not edit!
version = '$SAGE_VERSION'
date = '$SAGE_RELEASE_DATE'
EOF
# Rebuild the Sage library for the change in version.py to take effect
"$SAGE_ROOT/sage" -b
# Update the simplified Sage banner
"$SAGE_ROOT/sage" --python -c \
"import sage.misc.banner; sage.misc.banner.banner(full=False)" \
> "$SAGE_ROOT/VERSION.txt"
# Update Sage version file for shell scripts in SAGE_SRC/bin/sage-version.sh
cat <<EOF > "$SAGE_SRC/bin/sage-version.sh"
# Sage version information for shell scripts
# This file is auto-generated by the sage-update-version script, do not edit!
SAGE_VERSION='$SAGE_VERSION'
SAGE_RELEASE_DATE='$SAGE_RELEASE_DATE'
EOF
# Update the Sage banner
"$SAGE_ROOT/sage" --python -c \
"import sage.misc.banner; sage.misc.banner.banner(full=True)" \
> "$SAGE_SRC/bin/sage-banner"
# Regenerate auto-generated files tarball
"$SAGE_ROOT/bootstrap" -i -s
# Commit auto-generated changes
git commit -m "Updated SageMath version to $SAGE_VERSION" -- \
"$SAGE_ROOT/VERSION.txt" \
"$SAGE_SRC/sage/version.py" \
"$SAGE_SRC/bin/sage-version.sh" \
"$SAGE_SRC/bin/sage-banner" \
"$SAGE_ROOT/build/pkgs/configure/checksums.ini" \
"$SAGE_ROOT/build/pkgs/configure/package-version.txt" \
|| die "Error committing to the repository."
git tag -a "$SAGE_VERSION" -m "SageMath version $SAGE_VERSION" \
|| die "Error tagging the repository."
|