diff options
author | W. Trevor King <wking@tremily.us> | 2018-05-30 14:22:15 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-31 12:57:34 +0000 |
commit | e6b088fc6ee16f6c34013484c6d6d49c543435cb (patch) | |
tree | 83cb9ca26c450b02f506022d0df21670d5dd1e61 /test | |
parent | a127b4f312bcafe37df7ca8c40d1bedcbecc352c (diff) | |
download | podman-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 'test')
0 files changed, 0 insertions, 0 deletions