Skip to content

Commit

Permalink
Use python3 if python is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
mattaezell authored and thiell committed Sep 18, 2023
1 parent 7e3368f commit 1b96fdc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mkrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ if [ $# -lt 1 ]; then
exit 1
fi

which python &>/dev/null && PYTHON=python || PYTHON=python3
DIST=$1
FORCE=${2:-no}
VERS=$(python -c "import ClusterShell; print(ClusterShell.__version__)")
VERS=$($PYTHON -c "import ClusterShell; print(ClusterShell.__version__)")
PKGNAME=ClusterShell-$VERS

echo "Building version $VERS for $DIST"
Expand All @@ -47,7 +48,7 @@ if [ ! -f dist/$PKGNAME.tar.gz -o $FORCE = "force" ]; then
# Build base source package
#
rm -f dist/$PKGNAME.tar.gz
python setup.py sdist
$PYTHON setup.py sdist
ls -l $PWD/dist/$PKGNAME.tar.gz
md5sum dist/$PKGNAME.tar.gz
echo "Base source tarball successfully built"
Expand Down

0 comments on commit 1b96fdc

Please sign in to comment.