2017-03-28 16:41:41 +00:00
|
|
|
#
|
|
|
|
# \brief Helper for using the GNU privacy guard
|
|
|
|
# \author Norman Feske
|
|
|
|
# \date 2017-03-27
|
|
|
|
#
|
|
|
|
|
2018-09-21 11:48:33 +00:00
|
|
|
# Allow the gpg command to be overridden on the command line
|
|
|
|
GPG ?= gpg
|
|
|
|
|
2017-03-28 16:41:41 +00:00
|
|
|
pubkey_filename = $(call archive_user,$1)/pubkey
|
2022-01-04 15:43:06 +00:00
|
|
|
|
|
|
|
pubkey_path = $(firstword \
|
|
|
|
$(wildcard $(addsuffix /$(call pubkey_filename,$1), \
|
|
|
|
$(REP_SCULPT_DEPOT_DIRS))))
|
2017-03-28 16:41:41 +00:00
|
|
|
|
|
|
|
# obtain key ID of 'depot/<user>/pubkey' to be used to select signing key
|
2018-12-20 16:08:13 +00:00
|
|
|
pubkey_id = $(shell pubkey_file=$(call pubkey_path,$1); \
|
2024-05-23 04:24:13 +00:00
|
|
|
$(GPG) --dry-run --with-colon --import \
|
|
|
|
--import-options import-show $$pubkey_file 2> /dev/null |\
|
|
|
|
head -n 1 | cut -d: -f5)
|
2017-03-28 16:41:41 +00:00
|
|
|
|
|
|
|
MISSING_PUBKEY_FILES := $(sort \
|
|
|
|
$(foreach A,$(ARCHIVES),\
|
|
|
|
$(if $(call pubkey_path,$A),,\
|
2022-01-04 15:43:06 +00:00
|
|
|
$(call archive_user,$A))))
|
2017-03-28 16:41:41 +00:00
|
|
|
|
|
|
|
missing_pubkey_files:
|
2022-01-04 15:43:06 +00:00
|
|
|
@echo "Error: missing public-key files for:";\
|
2017-03-28 16:41:41 +00:00
|
|
|
for i in $(MISSING_PUBKEY_FILES); do echo " $$i"; done; false
|
|
|
|
|