tool/ports: streamline hash tool usage

This commit is contained in:
Christian Helmuth 2018-05-15 15:37:24 +02:00
parent 82897d672e
commit 66d44289e1
4 changed files with 8 additions and 14 deletions

View File

@ -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)

View File

@ -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.))

View File

@ -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)

View File

@ -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