mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Revert "Remove which
from shell invocations"
This commit is contained in:
parent
6b47efb57b
commit
13cc189a8a
@ -327,13 +327,13 @@ APPLICATION := $(strip $(APPLICATION))
|
|||||||
|
|
||||||
ifeq (,$(and $(DOWNLOAD_TO_STDOUT),$(DOWNLOAD_TO_FILE)))
|
ifeq (,$(and $(DOWNLOAD_TO_STDOUT),$(DOWNLOAD_TO_FILE)))
|
||||||
ifeq (,$(WGET))
|
ifeq (,$(WGET))
|
||||||
ifeq (,$(shell command -v wget))
|
ifeq (0,$(shell which wget > /dev/null 2>&1 ; echo $$?))
|
||||||
WGET = $(call memoized,WGET,$(shell command -v wget))
|
WGET = $(call memoized,WGET,$(shell which wget))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq (,$(CURL))
|
ifeq (,$(CURL))
|
||||||
ifneq (,$(shell command -v curl))
|
ifeq (0,$(shell which curl > /dev/null 2>&1 ; echo $$?))
|
||||||
CURL = $(call memoized,CURL,$(shell command -v curl))
|
CURL = $(call memoized,CURL,$(shell which curl))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq (,$(WGET)$(CURL))
|
ifeq (,$(WGET)$(CURL))
|
||||||
@ -349,11 +349,11 @@ ifeq (,$(and $(DOWNLOAD_TO_STDOUT),$(DOWNLOAD_TO_FILE)))
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (,$(UNZIP_HERE))
|
ifeq (,$(UNZIP_HERE))
|
||||||
ifneq (,$(shell command -v unzip))
|
ifeq (0,$(shell which unzip > /dev/null 2>&1 ; echo $$?))
|
||||||
UNZIP_HERE = $(call memoized,UNZIP_HERE,$(shell command -v unzip) -q)
|
UNZIP_HERE = $(call memoized,UNZIP_HERE,$(shell which unzip) -q)
|
||||||
else
|
else
|
||||||
ifneq (,$(shell command -v 7z))
|
ifeq (0,$(shell which 7z > /dev/null 2>&1 ; echo $$?))
|
||||||
UNZIP_HERE = $(call memoized,UNZIP_HERE,$(shell command -v 7z) x -bd)
|
UNZIP_HERE = $(call memoized,UNZIP_HERE,$(shell which 7z) x -bd)
|
||||||
else
|
else
|
||||||
$(warning Neither unzip nor 7z is installed.)
|
$(warning Neither unzip nor 7z is installed.)
|
||||||
endif
|
endif
|
||||||
|
@ -57,7 +57,7 @@ endif
|
|||||||
IOTLAB_AUTH ?= $(HOME)/.iotlabrc
|
IOTLAB_AUTH ?= $(HOME)/.iotlabrc
|
||||||
IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH))
|
IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH))
|
||||||
|
|
||||||
ifeq (,$(shell command -v iotlab-experiment))
|
ifneq (0,$(shell command -v iotlab-experiment -h 2>&1 > /dev/null ; echo $$?))
|
||||||
$(info $(COLOR_RED)'iotlab-experiment' command is not available \
|
$(info $(COLOR_RED)'iotlab-experiment' command is not available \
|
||||||
please consider installing it from \
|
please consider installing it from \
|
||||||
https://pypi.python.org/pypi/iotlabcli$(COLOR_RESET))
|
https://pypi.python.org/pypi/iotlabcli$(COLOR_RESET))
|
||||||
@ -66,7 +66,7 @@ endif
|
|||||||
|
|
||||||
ifeq (iotlab-a8-m3,$(BOARD))
|
ifeq (iotlab-a8-m3,$(BOARD))
|
||||||
ifneq (,$(filter flash% reset,$(MAKECMDGOALS)))
|
ifneq (,$(filter flash% reset,$(MAKECMDGOALS)))
|
||||||
ifeq (,$(shell command -v iotlab-ssh))
|
ifneq (0,$(shell command -v iotlab-ssh -h 2>&1 > /dev/null ; echo $$?))
|
||||||
$(info $(COLOR_RED)'iotlab-ssh' command is not available \
|
$(info $(COLOR_RED)'iotlab-ssh' command is not available \
|
||||||
please consider installing it from \
|
please consider installing it from \
|
||||||
https://pypi.python.org/pypi/iotlabsshcli$(COLOR_RESET))
|
https://pypi.python.org/pypi/iotlabsshcli$(COLOR_RESET))
|
||||||
|
28
dist/tools/buildsystem_sanity_check/check.sh
vendored
28
dist/tools/buildsystem_sanity_check/check.sh
vendored
@ -334,32 +334,6 @@ check_no_pkg_source_local() {
|
|||||||
| error_with_message "Don't push PKG_SOURCE_LOCAL definitions upstream"
|
| error_with_message "Don't push PKG_SOURCE_LOCAL definitions upstream"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_shell_which() {
|
|
||||||
local patterns=()
|
|
||||||
local pathspec=()
|
|
||||||
|
|
||||||
patterns+=(-e '(shell[[:blank:]]\+which')
|
|
||||||
|
|
||||||
pathspec+=('Makefile*')
|
|
||||||
pathspec+=('**/Makefile*')
|
|
||||||
pathspec+=('**/*.mk')
|
|
||||||
git -C "${RIOTBASE}" grep -n "${patterns[@]}" -- "${pathspec[@]}" \
|
|
||||||
| error_with_message "Don't use \`which\` in makefiles, use \`command -v\` instead."
|
|
||||||
}
|
|
||||||
|
|
||||||
check_stderr_null() {
|
|
||||||
local patterns=()
|
|
||||||
local pathspec=()
|
|
||||||
|
|
||||||
patterns+=(-e '2>[[:blank:]]*&1[[:blank:]]*>[[:blank:]]*/dev/null')
|
|
||||||
|
|
||||||
pathspec+=('Makefile*')
|
|
||||||
pathspec+=('**/Makefile*')
|
|
||||||
pathspec+=('**/*.mk')
|
|
||||||
git -C "${RIOTBASE}" grep -n "${patterns[@]}" -- "${pathspec[@]}" \
|
|
||||||
| error_with_message "Redirecting stderr and stdout to /dev/null is \`>/dev/null 2>&1\`; the other way round puts the old stderr to the new stdout."
|
|
||||||
}
|
|
||||||
|
|
||||||
error_on_input() {
|
error_on_input() {
|
||||||
! grep ''
|
! grep ''
|
||||||
}
|
}
|
||||||
@ -379,8 +353,6 @@ all_checks() {
|
|||||||
check_no_pseudomodules_in_makefile_dep
|
check_no_pseudomodules_in_makefile_dep
|
||||||
check_no_usemodules_in_makefile_include
|
check_no_usemodules_in_makefile_include
|
||||||
check_no_pkg_source_local
|
check_no_pkg_source_local
|
||||||
check_shell_which
|
|
||||||
check_stderr_null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
@ -34,9 +34,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Use full path in case it needs to be run with sudo
|
# Use full path in case it needs to be run with sudo
|
||||||
OPENV_SERVER_PATH := $(shell command -v openv-server)
|
OPENV_SERVER_PATH := $(shell which openv-server)
|
||||||
OPENV_CLIENT_PATH := $(shell command -v openv-client)
|
OPENV_CLIENT_PATH := $(shell which openv-client)
|
||||||
OPENV_SERIAL_PATH := $(shell command -v openv-serial)
|
OPENV_SERIAL_PATH := $(shell which openv-serial)
|
||||||
|
|
||||||
# Openvisualizer requires to know where openwsn-fw is located
|
# Openvisualizer requires to know where openwsn-fw is located
|
||||||
OPENV_OPENWSN_FW_PATH ?= --fw-path=$(RIOTBASE)/build/pkg/openwsn
|
OPENV_OPENWSN_FW_PATH ?= --fw-path=$(RIOTBASE)/build/pkg/openwsn
|
||||||
|
@ -25,7 +25,7 @@ TARGET_ARCH_RISCV ?= \
|
|||||||
$(subst -gcc,,\
|
$(subst -gcc,,\
|
||||||
$(notdir \
|
$(notdir \
|
||||||
$(word 1,\
|
$(word 1,\
|
||||||
$(foreach triple,$(_TRIPLES_TO_TEST),$(shell command -v $(triple)-gcc))))))
|
$(foreach triple,$(_TRIPLES_TO_TEST),$(shell which $(triple)-gcc 2> /dev/null))))))
|
||||||
|
|
||||||
TARGET_ARCH ?= $(TARGET_ARCH_RISCV)
|
TARGET_ARCH ?= $(TARGET_ARCH_RISCV)
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ ifeq ($(PROGRAMMER),)
|
|||||||
PROGRAMMER ?= edbg
|
PROGRAMMER ?= edbg
|
||||||
else ifeq ($(OPENOCD_DEBUG_ADAPTER),jlink)
|
else ifeq ($(OPENOCD_DEBUG_ADAPTER),jlink)
|
||||||
# only use JLinkExe if it's installed
|
# only use JLinkExe if it's installed
|
||||||
ifneq (,$(shell command -v JLinkExe))
|
ifneq (,$(shell which JLinkExe))
|
||||||
PROGRAMMER ?= jlink
|
PROGRAMMER ?= jlink
|
||||||
else
|
else
|
||||||
PROGRAMMER ?= openocd
|
PROGRAMMER ?= openocd
|
||||||
|
@ -2,7 +2,7 @@ INCLUDES += -I$(PKGDIRBASE)/flatbuffers/include
|
|||||||
|
|
||||||
FLATC ?= flatc
|
FLATC ?= flatc
|
||||||
|
|
||||||
ifeq (,$(shell command -v flatc ))
|
ifneq (0,$(shell which flatc > /dev/null 2>&1 ; echo $$?))
|
||||||
FLATC = $(RIOTTOOLS)/flatc/flatc
|
FLATC = $(RIOTTOOLS)/flatc/flatc
|
||||||
$(call target-export-variables,all,FLATC)
|
$(call target-export-variables,all,FLATC)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user