bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint.mk: don't require explicit gpg_key_ID in cfg.mk


From: Jim Meyering
Subject: [PATCH] maint.mk: don't require explicit gpg_key_ID in cfg.mk
Date: Thu, 31 Dec 2009 16:39:27 +0100

I've long wanted to avoid hard-coding my GPG key ID
in each project's cfg.mk file.  The stumbling block was
how to derive the key ID from the tag signature.
I wanted to avoid relying on the content of gpgv's (gpg --verify's)
diagnostic, but it seems other tools (at least one perl module)
do precisely that, so maybe it's good enough.

If anyone knows of a better way, please tell us.

>From d91a0d2dc678afe8a2c696077f0640e6874f52bc Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 31 Dec 2009 16:31:11 +0100
Subject: [PATCH] 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.
---
 ChangeLog    |    5 +++++
 top/maint.mk |    8 +++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ada6051..d5ff55f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-12-31  Jim Meyering  <address@hidden>

+       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-...
diff --git a/top/maint.mk b/top/maint.mk
index 2d25535..b90d2fe 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -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)                              \
--
1.6.6.325.g6f5f




reply via email to

[Prev in Thread] Current Thread [Next in Thread]