Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makefiles: Sort >/dev/null and 2>&1 #16775

Merged
merged 1 commit into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ APPLICATION := $(strip $(APPLICATION))

ifeq (,$(and $(DOWNLOAD_TO_STDOUT),$(DOWNLOAD_TO_FILE)))
ifeq (,$(WGET))
ifeq (0,$(shell which wget 2>&1 > /dev/null ; echo $$?))
ifeq (0,$(shell which wget > /dev/null 2>&1 ; echo $$?))
Copy link
Contributor

@benpicco benpicco Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it even necessary to redirect stderr to stdout at this point? It will be printed either way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying for minimal changes here; as that's apparently not called for (cf. #16775 (comment)), the latest additions do away with this.

WGET := $(shell which wget)
endif
endif
ifeq (,$(CURL))
ifeq (0,$(shell which curl 2>&1 > /dev/null ; echo $$?))
ifeq (0,$(shell which curl > /dev/null 2>&1 ; echo $$?))
CURL := $(shell which curl)
endif
endif
Expand All @@ -349,10 +349,10 @@ ifeq (,$(and $(DOWNLOAD_TO_STDOUT),$(DOWNLOAD_TO_FILE)))
endif

ifeq (,$(UNZIP_HERE))
ifeq (0,$(shell which unzip 2>&1 > /dev/null ; echo $$?))
ifeq (0,$(shell which unzip > /dev/null 2>&1 ; echo $$?))
UNZIP_HERE := $(shell which unzip) -q
else
ifeq (0,$(shell which 7z 2>&1 > /dev/null ; echo $$?))
ifeq (0,$(shell which 7z > /dev/null 2>&1 ; echo $$?))
UNZIP_HERE := $(shell which 7z) x -bd
else
$(error Neither unzip nor 7z is installed.)
Expand Down Expand Up @@ -714,7 +714,7 @@ endef
# This is not the case on MacOSX, so it must be built on the fly
ifeq ($(OS),Darwin)
ifneq (,$(filter debug, $(MAKECMDGOALS)))
ifneq (0,$(shell command -v setsid 2>&1 > /dev/null ; echo $$?))
ifneq (0,$(shell command -v setsid > /dev/null 2>&1 ; echo $$?))
SETSID = $(RIOTTOOLS)/setsid/setsid
$(call target-export-variables,debug,$(SETSID))
DEBUGDEPS += $(SETSID)
Expand Down
2 changes: 1 addition & 1 deletion makefiles/tools/gdb.inc.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# new versions of gdb will support all architectures in one binary
ifeq ($(shell gdb-multiarch -v 2>&1 > /dev/null; echo $$?),0)
ifeq ($(shell gdb-multiarch -v > /dev/null 2>&1; echo $$?),0)
export GDB ?= gdb-multiarch
else
export GDBPREFIX ?= $(PREFIX)
Expand Down
2 changes: 1 addition & 1 deletion makefiles/tools/riotgen.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-include makefiles/color.inc.mk

riotgen-installed:
@command -v riotgen 2>&1 > /dev/null || \
@command -v riotgen > /dev/null 2>&1 || \
{ $(COLOR_ECHO) \
"$(COLOR_RED)'riotgen' command is not available \
please consider installing it from \
Expand Down
2 changes: 1 addition & 1 deletion pkg/flatbuffers/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ INCLUDES += -I$(PKGDIRBASE)/flatbuffers/include

FLATC ?= flatc

ifneq (0,$(shell which flatc 2>&1 > /dev/null ; echo $$?))
ifneq (0,$(shell which flatc > /dev/null 2>&1 ; echo $$?))
FLATC = $(RIOTTOOLS)/flatc/flatc
$(call target-export-variables,all,FLATC)
endif
Expand Down