From 4e326bd9606ef6d4f7851bdca1ea8d5bcce85b73 Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 19 Aug 2018 20:27:46 +0200 Subject: Check PYTHON is properly defined We don't need to check for all the various versions, that's just a maintenance burden because `python33` shouldn't ever be available if `python3` isn't. Added a check for whether `PYTHON` is empty or just whitespace because that's useless and could actually lead to problems, if `setup.py` happens to be on the `PATH`. --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1c3745a6..611bb7c3 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,16 @@ NAME_RIFLE = rifle VERSION_RIFLE = $(VERSION) SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz # Find suitable python version (need python >= 2.6 or 3.1): -PYTHON ?= $(shell python -c 'import sys; sys.exit(sys.version < "2.6")' && \ - which python3 || which python3.6 || which python3.5 || which python3.4 || \ - which python3.3 || which python3.2 || which python3.1 || \ - which python || which python2.7 || which python2.6) +PYTHON ?= $(shell \ + (python -c 'import sys; sys.exit(sys.version < "2.6")' && \ + which python) \ + || (which python3) \ + || (python2 -c 'import sys; sys.exit(sys.version < "2.6")' && \ + which python2) \ + ) +ifeq ($(strip $(PYTHON)),) + $(error No suitable python found.) +endif SETUPOPTS ?= '--record=install_log.txt' DOCDIR ?= doc/pydoc DESTDIR ?= / -- cgit 1.4.1-2-gfad0