Skip to content

Commit

Permalink
build/pkgs/python3/spkg-configure.m4: use "cut" for minor component
Browse files Browse the repository at this point in the history
Use the "cut" utility to parse the python minor version component
instead of sed -E. Despite what the GNU sed manpage says, the "-E"
flag does not actually appear in any version of POSIX, while "cut"
does. The cut version is also a bit more readable.
  • Loading branch information
orlitzky committed Sep 1, 2023
1 parent a6081be commit 84bf9a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/pkgs/python3/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ To build Sage with a different system python, use ./configure --with-python=/pat
AS_IF([test -n "$PYTHON_FOR_VENV"],
[PYTHON_VERSION=$("$PYTHON_FOR_VENV" -c "import sysconfig; print(sysconfig.get_python_version())")],
[PYTHON_VERSION=$(echo $(cat build/pkgs/python3/package-version.txt))])
AC_SUBST([PYTHON_MINOR], [$(echo $PYTHON_VERSION | sed -E 's/[[0-9]]*\.([[0-9]]*).*/\1/')])
AC_SUBST([PYTHON_MINOR], [$(echo $PYTHON_VERSION | cut -d. -f2)])
export PYTHON_MINOR # for sage-get-system-packages
AS_VAR_IF([SAGE_VENV], [auto], [SAGE_VENV=$SAGE_VENV_AUTO])
Expand Down

0 comments on commit 84bf9a3

Please sign in to comment.