mirror of
https://github.com/containers/podman.git
synced 2025-06-19 08:09:12 +08:00
contrib/python/*/Makefile: Fallback to unversioned 'python'
And pull these from the PATH by default. This way systems like CentOS that don't have a python3 can still execute 'make clean', which doesn't care about the Python major version. The setup.py shebang, mode change, and ./ prefixing helps address cases where PYTHON is empty. This could be the result of improper user configuration: $ make PYTHON='' clean It could also be the state on systems with no Python installed, in which case you'll see: $ make PYTHON='' clean ./setup.py clean --all /usr/bin/env: 'python': No such file or directory make: *** [Makefile:13: clean] Error 127 I've also shifted the Python invocations to the end of the clean recipies so that as much as possible gets cleaned up even on systems without Python installed. Signed-off-by: W. Trevor King <wking@tremily.us>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
PYTHON ?= /usr/bin/python3
|
||||
PYTHON ?= $(shell command -v python3 2>/dev/null || command -v python)
|
||||
DESTDIR ?= /
|
||||
|
||||
.PHONY: python-podman
|
||||
@ -26,7 +26,7 @@ uninstall:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(PYTHON) setup.py clean --all
|
||||
rm -rf podman.egg-info dist
|
||||
find . -depth -name __pycache__ -exec rm -rf {} \;
|
||||
find . -depth -name \*.pyc -exec rm -f {} \;
|
||||
$(PYTHON) ./setup.py clean --all
|
||||
|
2
contrib/python/podman/setup.py
Normal file → Executable file
2
contrib/python/podman/setup.py
Normal file → Executable file
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
@ -1,4 +1,4 @@
|
||||
PYTHON ?= /usr/bin/python3
|
||||
PYTHON ?= $(shell command -v python3 2>/dev/null || command -v python)
|
||||
DESTDIR := /
|
||||
|
||||
.PHONY: python-pypodman
|
||||
@ -25,7 +25,7 @@ clobber: uninstall clean
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(PYTHON) setup.py clean --all
|
||||
rm -rf pypodman.egg-info dist
|
||||
find . -depth -name __pycache__ -exec rm -rf {} \;
|
||||
find . -depth -name \*.pyc -exec rm -f {} \;
|
||||
$(PYTHON) ./setup.py clean --all
|
||||
|
2
contrib/python/pypodman/setup.py
Normal file → Executable file
2
contrib/python/pypodman/setup.py
Normal file → Executable file
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
Reference in New Issue
Block a user