Commit 57189c08 authored by Anthony Mallet's avatar Anthony Mallet
Browse files

[mk] Clean the inter-dependencies of the checksum-vars.mk and checksum.mk files

Like for other *-vars.mk files, checksum-vars.mk should be includable without
triggering the {bootstrap-,}dependencies associated to the actual checksum
targets. This commit leaves only the variable definitions in checksum-vars.mk,
moving the rest to checksum.mk

This way, the checkout target does not artificially inherit from the 'digest'
dependency which is useless when working with a checked out package.
parent 8c91f5c6
#
# Copyright (c) 2006-2011,2013 LAAS/CNRS
# Copyright (c) 2006-2011,2013,2018 LAAS/CNRS
# Copyright (c) 1994-2006 The NetBSD Foundation, Inc.
# All rights reserved.
#
......@@ -53,59 +53,17 @@ _DIGEST_ALGORITHMS?= SHA1 RMD160
_PATCH_DIGEST_ALGORITHMS?= SHA1
_CONF_DIGEST_ALGORITHMS?= SHA1
# Archives that are retrived from a repository are digested with archive's
# Archives that are retrieved from a repository are digested with archive's
# metadata reset to known values (owner/group id, mtime, dev, umask).
ifneq (,$(filter cvs git mercurial svn,${FETCH_METHOD}))
_DIGEST_ARGS+= -c
endif
# The following are the "public" targets provided by this module:
#
# checksum, makesum, makepatchsum, distinfo
#
$(call require, ${ROBOTPKG_DIR}/mk/fetch/fetch-vars.mk)
# --- checksum (PUBLIC) ----------------------------------------------------
#
# checksum is a public target to checksum the fetched distfiles
# for the package.
#
.PHONY: checksum
ifdef NO_CHECKSUM
$(call require, ${ROBOTPKG_DIR}/mk/fetch/fetch.mk)
$(call require, ${ROBOTPKG_DIR}/mk/extract/extract-vars.mk)
ifdef _EXTRACT_IS_CHECKOUT
checksum: bootstrap-depends
else
checksum: fetch
endif
checksum:
@${DO_NADA}
else
include ${ROBOTPKG_DIR}/mk/checksum/checksum.mk
endif
# --- distinfo, makesum, makepatchsum (PUBLIC) -----------------------------
#
# distinfo is a public target to create ${DISTINFO_FILE}.
#
# makesum is a public target to add checksums of the distfiles for
# the package to ${DISTINFO_FILE}.
#
# makepatchsum is a public target to add checksums of the patches
# for the package to ${DISTINFO_FILE}.
#
.PHONY: distinfo
ifdef NO_CHECKSUM
distinfo:
@${DO_NADA}
else
include ${ROBOTPKG_DIR}/mk/checksum/distinfo.mk
ifneq (,$(filter cvs git mercurial svn,${FETCH_METHOD}))
_DIGEST_ARGS+= -c
endif
# A short alias for "distinfo".
.PHONY: mdi
mdi: $(call add-barrier, bootstrap-depends, mdi) distinfo
# The command for computing a file's checksum
_CHECKSUM_CMD= ${SETENV} \
DIGEST=$(call quote,$(strip ${DIGEST} ${_DIGEST_ARGS})) \
CAT=${CAT} TEST=${TEST} ECHO=${ECHO} \
${SH} ${ROBOTPKG_DIR}/mk/checksum/checksum
#
# Copyright (c) 2006-2013 LAAS/CNRS
# Copyright (c) 2006-2013,2018 LAAS/CNRS
# Copyright (c) 1994-2006 The NetBSD Foundation, Inc.
# All rights reserved.
#
......@@ -45,15 +45,9 @@
# This variable is set by robotpkg/mk/fetch/fetch-vars.mk.
# CKSUMFILES?= $(filter-out ${IGNOREFILES},${ALLFILES})
# Require digest tool
DEPEND_METHOD.digest+= bootstrap
include ${ROBOTPKG_DIR}/pkgtools/digest/depend.mk
# The command for computing a file's checksum
_CHECKSUM_CMD= ${SETENV} \
DIGEST=$(call quote,$(strip ${DIGEST} ${_DIGEST_ARGS})) \
CAT=${CAT} TEST=${TEST} ECHO=${ECHO} \
${SH} ${ROBOTPKG_DIR}/mk/checksum/checksum
$(call require, ${ROBOTPKG_DIR}/mk/fetch/fetch-vars.mk)
$(call require, ${ROBOTPKG_DIR}/mk/checksum/checksum-vars.mk)
$(call require, ${ROBOTPKG_DIR}/mk/extract/extract-vars.mk)
# --- checksum (PUBLIC) ----------------------------------------------
......@@ -61,8 +55,6 @@ _CHECKSUM_CMD= ${SETENV} \
# checksum is a public target to checksum the fetched distfiles
# for the package.
#
$(call require, ${ROBOTPKG_DIR}/mk/fetch/fetch-vars.mk)
$(call require, ${ROBOTPKG_DIR}/mk/extract/extract-vars.mk)
$(call require, ${ROBOTPKG_DIR}/mk/depends/depends-vars.mk)
_CHECKSUM_TARGETS= $(call add-barrier, bootstrap-depends, checksum)
......@@ -72,7 +64,13 @@ ifndef _EXTRACT_IS_CHECKOUT
$(call require, ${ROBOTPKG_DIR}/mk/fetch/fetch.mk)
_CHECKSUM_TARGETS+= fetch
endif
_CHECKSUM_TARGETS+= checksum-files
ifndef NO_CHECKSUM
# Require digest tool
DEPEND_METHOD.digest+= bootstrap
include ${ROBOTPKG_DIR}/pkgtools/digest/depend.mk
_CHECKSUM_TARGETS+= checksum-files
endif
endif
.PHONY: checksum
......
#
# Copyright (c) 2009-2011,2013 LAAS/CNRS
# Copyright (c) 2009-2011,2013,2018 LAAS/CNRS
# Copyright (c) 1994-2006 The NetBSD Foundation, Inc.
# All rights reserved.
#
......@@ -43,36 +43,45 @@
#
$(call require, ${ROBOTPKG_DIR}/mk/fetch/fetch-vars.mk)
$(call require, ${ROBOTPKG_DIR}/mk/checksum/checksum-vars.mk)
# This variable is set by robotpkg/mk/fetch/fetch-vars.mk.
# CKSUMFILES?= $(filter-out ${IGNOREFILES},${ALLFILES})
# Require digest tool
DEPEND_METHOD.digest+= bootstrap
include ${ROBOTPKG_DIR}/pkgtools/digest/depend.mk
# --- distinfo (PUBLIC) ----------------------------------------------------
#
# distinfo is a public target to create ${DISTINFO_FILE}.
#
_DISTINFO_TARGETS= $(call add-barrier, bootstrap-depends, distinfo)
ifneq ($(words ${_CKSUMFILES}),\
ifndef NO_CHECKSUM
$(call require, ${ROBOTPKG_DIR}/mk/depends/depends-vars.mk)
# Require digest tool
DEPEND_METHOD.digest+= bootstrap
include ${ROBOTPKG_DIR}/pkgtools/digest/depend.mk
_DISTINFO_TARGETS= $(call add-barrier, bootstrap-depends, distinfo)
ifneq ($(words ${_CKSUMFILES}),\
$(words $(wildcard $(addprefix ${DISTDIR}/,${_CKSUMFILES}))))
$(call require, ${ROBOTPKG_DIR}/mk/fetch/fetch.mk)
_DISTINFO_TARGETS+= fetch
$(call require, ${ROBOTPKG_DIR}/mk/fetch/fetch.mk)
_DISTINFO_TARGETS+= fetch
endif
_DISTINFO_TARGETS+= distinfo-message
_DISTINFO_TARGETS+= makesum
_DISTINFO_TARGETS+= makepatchsum
endif
_DISTINFO_TARGETS+= distinfo-message
_DISTINFO_TARGETS+= makesum
_DISTINFO_TARGETS+= makepatchsum
.PHONY: distinfo
distinfo: ${_DISTINFO_TARGETS};
.PHONY: distinfo-message
distinfo-message:
@${PHASE_MSG} "Creating checksums for ${PKGNAME}"
# A short alias for "distinfo".
.PHONY: mdi
mdi: $(call add-barrier, bootstrap-depends, mdi) distinfo
# --- makesum (PRIVATE) ----------------------------------------------------
#
......
#
# Copyright (c) 2006-2013 LAAS/CNRS
# Copyright (c) 2006-2013,2018 LAAS/CNRS
# All rights reserved.
#
# This project includes software developed by the NetBSD Foundation, Inc.
......@@ -43,15 +43,26 @@
# EXTRACT_SUFX is the suffix for the default distfile to be
# extracted. The default suffix is ".tar.gz".
#
$(call require,${ROBOTPKG_DIR}/mk/fetch/fetch-vars.mk)
EXTRACT_ONLY?= ${FETCH_ONLY}
EXTRACT_SUFX?= .tar.gz
EXTRACT_DIR?= ${WRKDIR}
_COOKIE.extract= ${WRKDIR}/.extract_cookie
_COOKIE.checkout= ${WRKDIR}/.checkout_cookie
# test for checkouts
ifneq (,$(filter checkout,${MAKECMDGOALS}))
_EXTRACT_IS_CHECKOUT:=yes
endif
ifeq (yes,$(call exists,${_COOKIE.checkout}))
_EXTRACT_IS_CHECKOUT:=yes
endif
ifndef _EXTRACT_IS_CHECKOUT
$(call require,${ROBOTPKG_DIR}/mk/fetch/fetch-vars.mk)
EXTRACT_ONLY?= ${FETCH_ONLY}
EXTRACT_SUFX?= .tar.gz
EXTRACT_DIR?= ${WRKDIR}
endif
# let users override the MASTER_REPOSITORY defined in a package
ifdef REPOSITORY.${PKGBASE}
......@@ -72,14 +83,6 @@ else ifdef CHECKOUT
_CHECKOUT=${CHECKOUT}
endif
# test for checkouts
ifneq (,$(filter checkout,${MAKECMDGOALS}))
_EXTRACT_IS_CHECKOUT:=yes
endif
ifeq (yes,$(call exists,${_COOKIE.checkout}))
_EXTRACT_IS_CHECKOUT:=yes
endif
# redefine package name for checkouts
ifdef _EXTRACT_IS_CHECKOUT
CHECKOUT_PKGVERSION:=${_ROBOTPKG_NOW}
......
#
# Copyright (c) 2006-2013 LAAS/CNRS
# Copyright (c) 2006-2013,2018 LAAS/CNRS
# All rights reserved.
#
# This project includes software developed by the NetBSD Foundation, Inc.
......@@ -128,7 +128,7 @@ release-extract-lock: release-lock
ifeq (yes,$(call exists,${_COOKIE.extract}))
$(call require,${_COOKIE.extract})
else
$(call require, ${ROBOTPKG_DIR}/mk/checksum/checksum-vars.mk)
$(call require, ${ROBOTPKG_DIR}/mk/checksum/checksum.mk)
${_COOKIE.extract}: real-extract;
endif
......
#
# Copyright (c) 2006-2011,2013 LAAS/CNRS
# Copyright (c) 2006-2011,2013,2018 LAAS/CNRS
# Copyright (c) 1994-2006 The NetBSD Foundation, Inc.
# All rights reserved.
#
......@@ -129,7 +129,6 @@ release-patch-lock: release-lock
ifeq (yes,$(call exists,${_COOKIE.patch}))
$(call require,${_COOKIE.patch})
else
$(call require, ${ROBOTPKG_DIR}/mk/checksum/checksum-vars.mk)
${_COOKIE.patch}: real-patch;
endif
......
......@@ -90,8 +90,10 @@ $(call require-for, mirror-distfiles, \
${ROBOTPKG_DIR}/mk/fetch/mirror.mk)
# Checksum
$(call require-for, checksum mdi distinfo, \
${ROBOTPKG_DIR}/mk/checksum/checksum-vars.mk)
$(call require-for, checksum, \
${ROBOTPKG_DIR}/mk/checksum/checksum.mk)
$(call require-for, mdi distinfo, \
${ROBOTPKG_DIR}/mk/checksum/distinfo.mk)
# Extract
$(call require-for, extract, \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment