maint.mk: don't require explicit gpg_key_ID in cfg.mk
authorJim Meyering <meyering@redhat.com>
Thu, 31 Dec 2009 15:31:11 +0000 (16:31 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 31 Dec 2009 15:38:54 +0000 (16:38 +0100)
* top/maint.mk (gpg_key_ID): Derive key ID from signed release tag.
With this change, we can all remove the gpg_key_ID = ... definition
from our respective cfg.mk files.

ChangeLog
top/maint.mk

index ada6051b5dccaad0f3b11f97d8b73c6f3e792b76..d5ff55f30c843ac33a997f562e220795590651b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-12-31  Jim Meyering  <meyering@redhat.com>
 
+       maint.mk: don't require explicit gpg_key_ID in cfg.mk
+       * top/maint.mk (gpg_key_ID): Derive key ID from signed release tag.
+       With this change, we can all remove the gpg_key_ID = ... definition
+       from our respective cfg.mk files.
+
        maint.mk: create announcement template in ~/, not in /tmp
        * top/maint.mk (emit_upload_commands): Adjust.
        (release-prep): Emit into ~/announce-..., not /tmp/announce-...
index 2d25535db0c3e0046f8e7994d851d637c9e7c53a..b90d2fe5d34dbdb5bcf504c54108f4794d534b8b 100644 (file)
@@ -30,7 +30,6 @@ gzip_rsyncable := \
   $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
 GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
 
-# cfg.mk must define the gpg_key_ID used by this package.
 GIT = git
 VC = $(GIT)
 VC-tag = git tag -s -m '$(VERSION)' -u '$(gpg_key_ID)'
@@ -688,6 +687,13 @@ gnulib_dir ?= $(srcdir)/gnulib
 gnulib-version = $$(cd $(gnulib_dir) && git describe)
 bootstrap-tools ?= autoconf,automake,gnulib
 
+# If it's not already specified, derive the GPG key ID from
+# the signed tag we've just applied to mark this release.
+gpg_key_ID ?= \
+  $$(git cat-file tag v$(VERSION) > .ann-sig \
+     && gpgv .ann-sig - < /dev/null 2>&1 \
+         | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig)
+
 announcement: NEWS ChangeLog $(rel-files)
        @$(build_aux)/announce-gen                                      \
            --release-type=$(RELEASE_TYPE)                              \