From fa9c9055053172ba8653c9543e4195e0207c7543 Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Wed, 3 Jun 2020 11:30:49 -0700 Subject: Fix test release commands to work with older GPG. The --quick-generate-key command wasn't added until recently. PiperOrigin-RevId: 314570297 --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d6cd9ec03..85818ebea 100644 --- a/Makefile +++ b/Makefile @@ -171,12 +171,20 @@ RELEASE_COMMIT := RELEASE_NAME := RELEASE_NOTES := +GPG_TEST_OPTIONS := $(shell if gpg --pinentry-mode loopback --version >/dev/null 2>&1; then echo --pinentry-mode loopback; fi) $(RELEASE_KEY): @echo "WARNING: Generating a key for testing ($@); don't use this." T=$$(mktemp /tmp/keyring.XXXXXX); \ - gpg --no-default-keyring --keyring $$T --batch --passphrase "" --quick-generate-key $(shell whoami) && \ - gpg --export-secret-keys --no-default-keyring --keyring $$T > $@; \ - rc=$$?; rm -f $$T; exit $$rc + C=$$(mktemp /tmp/config.XXXXXX); \ + echo Key-Type: DSA >> $$C && \ + echo Key-Length: 1024 >> $$C && \ + echo Name-Real: Test >> $$C && \ + echo Name-Email: test@example.com >> $$C && \ + echo Expire-Date: 0 >> $$C && \ + echo %commit >> $$C && \ + gpg --batch $(GPG_TEST_OPTIONS) --passphrase '' --no-default-keyring --keyring $$T --no-tty --gen-key $$C && \ + gpg --batch $(GPG_TEST_OPTIONS) --export-secret-keys --no-default-keyring --keyring $$T --secret-keyring $$T > $@; \ + rc=$$?; rm -f $$T $$C; exit $$rc release: $(RELEASE_KEY) ## Builds a release. @mkdir -p $(RELEASE_ROOT) -- cgit v1.2.3