summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-08-02 23:38:26 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2022-08-03 01:06:24 -0400
commit9a4ae96b970ab97c51a70298cd421ef100e7d39c (patch)
treebc708a3024681f374fbf761a16b22e0323998d4d
parent714a8a8777d6c3398859e42ca1ce9d1014769a43 (diff)
housekeeping
-rwxr-xr-xbin/pacman-make-keyring29
1 files changed, 18 insertions, 11 deletions
diff --git a/bin/pacman-make-keyring b/bin/pacman-make-keyring
index 9b1109c..92ebff1 100755
--- a/bin/pacman-make-keyring
+++ b/bin/pacman-make-keyring
@@ -1,7 +1,8 @@
#!/usr/bin/make -rRf
-# Usage: pacman-make-keyring V=$(date -u +%Y%m%d)
+# Usage: pacman-make-keyring V=$(date -u +%Y%m%d) [ keyserver=<HKP_URL> ]
-# Copyright 2014, 2016 Luke Shumaker <lukeshu@sbcglobal.net>.
+# Copyright 2014,2016 Luke Shumaker <lukeshu@sbcglobal.net>
+# Copyright 2021-2022 bill-auger <bill-auger@programmer.net>
#
# This is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -17,20 +18,26 @@
# License along with this manual; if not, see
# <http://www.gnu.org/licenses/>.
+
+# apply config
+KEYRING_NAME = parabola
+bin := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+yamldir := $(shell ruby -e "load '$(bin)/common.rb'; print cfg['yamldir']")
+cachedir := $(shell ruby -e "load '$(bin)/common.rb'; print cfg['keyring_cachedir']")
+outputdir = $(cachedir)/$(KEYRING_NAME)-keyring-$(V)
+
+# sanity checks
ifeq ($(origin V),undefined)
-$(info Usage: pacman-make-keyring V=$$(date -u +%Y%m%d))
-$(error You must set V= on the command line)
+ $(info Usage: pacman-make-keyring V=$$(date -u +%Y%m%d) [ keyserver=<HKP_URL> ]) $(info)
+ $(error V= must be set in the environment, on the command line, etc)
endif
ifeq ($(origin keyserver),undefined)
-keyserver = hkp://pgp.cyberbits.eu:11371
+ keyserver := hkp://pgp.cyberbits.eu:11371
+endif
+ifneq ($(findstring hkp://,${keyserver}),hkp://)
+ $(error keyserver must be a valid hkp:// URL)
endif
-
-bin := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
-yamldir := $(shell ruby -e "load '$(bin)/common.rb'; print cfg['yamldir']")
-cachedir := $(shell ruby -e "load '$(bin)/common.rb'; print cfg['keyring_cachedir']")
-outputdir = $(cachedir)/$(KEYRING_NAME)-keyring-$(V)
-KEYRING_NAME = parabola
all: $(KEYRING_NAME)-keyring-$(V).tar.gz
.PHONY: all