WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
prevailing on the system - e.g. "3", "36"
Fixes: 9426f1f2045d0ae0f319530c3dc3a9240d838d07
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit
f8aac6f69b2d5e28f428e9f7a64beac5878452ff)
if [ "$WITH_PYTHON2" = "ON" ]; then
ENV_LIST+="py27,"
fi
-if [ "$WITH_PYTHON3" = "3" ]; then
+# WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
+# prevailing on the system - e.g. "3", "36"
+if [[ "$WITH_PYTHON3" =~ (^3|^ON) ]]; then
ENV_LIST+="py3,"
fi
# use bash string manipulation to strip off any trailing comma
ENV_LIST+="py27-cov,py27-lint,"
fi
fi
-if [ "$WITH_PYTHON3" = "3" ]; then
+# WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
+# prevailing on the system - e.g. "3", "36"
+if [[ "$WITH_PYTHON3" =~ (^3|^ON) ]]; then
if [[ -n "$@" ]]; then
ENV_LIST+="py3-run,"
else
if [ "$WITH_PYTHON2" = "ON" ]; then
ENV_LIST+="py27,"
fi
-if [ "$WITH_PYTHON3" = "3" ]; then
+# WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
+# prevailing on the system - e.g. "3", "36"
+if [[ "$WITH_PYTHON3" =~ (^3|^ON) ]]; then
ENV_LIST+="py3,"
fi
# use bash string manipulation to strip off any trailing comma
if [ "$WITH_PYTHON2" = "ON" ]; then
ENV_LIST+="py27,"
fi
-if [ "$WITH_PYTHON3" = "3" ]; then
+# WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
+# prevailing on the system - e.g. "3", "36"
+if [[ "$WITH_PYTHON3" =~ (^3|^ON) ]]; then
ENV_LIST+="py3,"
fi
-ENV_LIST=$(echo "$ENV_LIST" | sed -e 's/,$//')
-
# use bash string manipulation to strip off any trailing comma
ENV_LIST=${ENV_LIST%,}