summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2018-05-30 14:22:15 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-31 12:57:34 +0000
commite6b088fc6ee16f6c34013484c6d6d49c543435cb (patch)
tree83cb9ca26c450b02f506022d0df21670d5dd1e61 /Makefile
parenta127b4f312bcafe37df7ca8c40d1bedcbecc352c (diff)
downloadpodman-e6b088fc6ee16f6c34013484c6d6d49c543435cb.tar.gz
podman-e6b088fc6ee16f6c34013484c6d6d49c543435cb.tar.bz2
podman-e6b088fc6ee16f6c34013484c6d6d49c543435cb.zip
Makefile: Add stderr redirect to HAS_PYTHON3 definition
For two reasons: * When a system is missing python3, we don't need to spam them with "Command not found" in their stderr. * Without the redirect, GNU Make (at least version 4.2.1) is overly clever and tries to invoke the command itself, not realizing that it's a shell builtin [1]. $ make --version GNU Make 4.2.1 Built for aarch64-unknown-linux-gnu Copyright (C) 1988-2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. $ cat Makefile PYTHON3_A := $(shell command -v python3) PYTHON3_B := $(shell command -v python3 2>/dev/null) test: @echo "SHELL: '$(SHELL)'" @echo "PYTHON3_A: '$(PYTHON3_A)'" @echo "PYTHON3_B: '$(PYTHON3_B)'" $ make make: command: Command not found SHELL: '/bin/sh' PYTHON3_A: '' PYTHON3_B: '/usr/bin/python3' By adding the redirect we actually hit the shell and can successfully invoke command. [1]: https://stackoverflow.com/a/17550243 Signed-off-by: W. Trevor King <wking@tremily.us> Closes: #856 Approved by: rhatdan
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 065d7ef6f..d54e6fd76 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ TMPFILESDIR ?= ${PREFIX}/lib/tmpfiles.d
SYSTEMDDIR ?= ${PREFIX}/lib/systemd/system
BUILDTAGS ?= seccomp $(shell hack/btrfs_tag.sh) $(shell hack/libdm_tag.sh) $(shell hack/btrfs_installed_tag.sh) $(shell hack/ostree_tag.sh) $(shell hack/selinux_tag.sh)
PYTHON ?= /usr/bin/python3
-HAS_PYTHON3 := $(shell command -v python3)
+HAS_PYTHON3 := $(shell command -v python3 2>/dev/null)
BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions
OCIUMOUNTINSTALLDIR=$(PREFIX)/share/oci-umount/oci-umount.d