Skip to content

Commit 1b96fdc

Browse files
mattaezellthiell
authored andcommitted
Use python3 if python is not installed
1 parent 7e3368f commit 1b96fdc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mkrpm.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ if [ $# -lt 1 ]; then
2727
exit 1
2828
fi
2929

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

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

0 commit comments

Comments
 (0)