From 66d44289e13c63897367e1f6744d234366fe6802 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 15 May 2018 15:37:24 +0200 Subject: [PATCH] tool/ports: streamline hash tool usage --- tool/ports/mk/check.mk | 5 ----- tool/ports/mk/common.inc | 6 +++++- tool/ports/mk/hash.inc | 4 +++- tool/ports/mk/install.mk | 7 ------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/tool/ports/mk/check.mk b/tool/ports/mk/check.mk index 38c7b7f070..63afaeb289 100644 --- a/tool/ports/mk/check.mk +++ b/tool/ports/mk/check.mk @@ -12,11 +12,6 @@ check: -# -# Utility to check if a tool is installed -# -check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) - $(call check_tool,curl) $(call check_tool,git) $(call check_tool,svn) diff --git a/tool/ports/mk/common.inc b/tool/ports/mk/common.inc index ebe59f0e90..f2bbcc1e84 100644 --- a/tool/ports/mk/common.inc +++ b/tool/ports/mk/common.inc @@ -7,7 +7,6 @@ SHELL := bash VERBOSE ?= @ ECHO := echo -e -HASHSUM := sha1sum BRIGHT_COL ?= \x1b[01;33m DARK_COL ?= \x1b[00;33m @@ -25,3 +24,8 @@ MSG_GIT := $(MSG_PREFIX_TXT)git # Force stable sorting order export LC_COLLATE=C + +# +# Utility to check if a tool is installed +# +check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) diff --git a/tool/ports/mk/hash.inc b/tool/ports/mk/hash.inc index 4791135721..d26ffca048 100644 --- a/tool/ports/mk/hash.inc +++ b/tool/ports/mk/hash.inc @@ -15,6 +15,8 @@ # STRICT_HASH to 'no', the MAKEFILE_LIST can be exluded. # +$(call check_tool,sha1sum) + _PATCHES_IN_REP_DIR := $(foreach P,$(PATCHES),\ $(wildcard $(REP_DIR)/$(subst $(REP_DIR)/,,$(P)))) @@ -25,7 +27,7 @@ endif $(_DST_HASH_FILE): $(HASH_INPUT) $(MAKEFILE_LIST) @$(MSG_GENERATE)$(notdir $@) - $(VERBOSE)cat $(HASH_INPUT) | $(HASHSUM) | sed "s/ .*//" > $@ + $(VERBOSE)cat $(HASH_INPUT) | sha1sum | sed "s/ .*//" > $@ _check_hash: $(_DST_HASH_FILE) ifneq ($(CHECK_HASH),no) diff --git a/tool/ports/mk/install.mk b/tool/ports/mk/install.mk index 9b4808ae5f..bb1aeadcc3 100644 --- a/tool/ports/mk/install.mk +++ b/tool/ports/mk/install.mk @@ -20,11 +20,6 @@ # XXX remove this line when the tool has stabilized STRICT_HASH ?= no -# -# Utility to check if a tool is installed -# -check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.)) - # # Utility to check if a python module is installed # @@ -59,9 +54,7 @@ include $(GENODE_DIR)/tool/ports/mk/common.inc $(call check_tool,wget) $(call check_tool,patch) -$(call check_tool,sha1sum) $(call check_tool,sha256sum) -$(call check_tool,$(HASHSUM)) # # Assertion for the presence of a LICENSE and VERSION declarations in the port