From owner-cvs-all Tue Jan 22 1:48:37 2002 Delivered-To: cvs-all@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 33BA537B443; Tue, 22 Jan 2002 01:47:39 -0800 (PST) Received: by flood.ping.uio.no (Postfix, from userid 2602) id A6DCC533B; Tue, 22 Jan 2002 10:47:34 +0100 (CET) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Murray Stokely Cc: Jun Kuriyama , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: doc/en_US.ISO8859-1/books/handbook/pgpkeys chapter.sgml References: <200201211616.g0LGGFH54977@freefall.freebsd.org> <20020122054120.GT21973@freebsdmall.com> From: Dag-Erling Smorgrav Date: 22 Jan 2002 10:47:33 +0100 In-Reply-To: Message-ID: Lines: 10 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-=-= Here's a better patch - it handles users with multiple keys, including all keys that match the id(s) specified on the command line (or ${me}@freebsd.org), and ${me} defaults to $(id -nu). DES -- Dag-Erling Smorgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=pgpkeys.diff Index: book.sgml =================================================================== RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/book.sgml,v retrieving revision 1.120 diff -u -r1.120 book.sgml --- book.sgml 1 Jan 2002 09:43:37 -0000 1.120 +++ book.sgml 22 Jan 2002 09:04:24 -0000 @@ -50,6 +50,7 @@ + %pgpkeys; ]> Index: pgpkeys/addkey.sh =================================================================== RCS file: pgpkeys/addkey.sh diff -N pgpkeys/addkey.sh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pgpkeys/addkey.sh 22 Jan 2002 09:46:22 -0000 @@ -0,0 +1,75 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +me="$1" +if [ -z "${me}" ]; then + me=$(id -nu) +else + shift +fi + +id="$@" +if [ -z "${id}" ]; then + id="${me}@freebsd.org" +fi + +gpg=$(which gpg) + + + +if [ ! -x "${gpg}" ]; then + echo "GnuPG does not seem to be installed" >/dev/stderr + exit 1 +fi + +echo "Retrieving key..." +keylist=$(gpg --list-keys ${id}) +id=$(echo "${keylist}" | awk '/^pub/ { print $2 }' | sed 's%.*/%%') +if [ "${#id}" -lt 8 ]; then + echo "Invalid key ID." >/dev/stderr + exit 1 +elif [ "${#id}" -gt 8 ]; then + echo "WARNING: Multiple keys; exporting all. If this is not what you want," >/dev/stderr + echo "WARNING: you should specify a key ID on the command line." >/dev/stderr +fi +fp=$(gpg --fingerprint ${id}) +[ $? -eq 0 ] || exit 1 +tmp=$(echo ${id} | sed 's/[[:<:]]/--export /') +key=$(gpg --armor ${tmp}) +[ $? -eq 0 ] || exit 1 + +keyfile="${me}.key" +echo "Generating ${keyfile}..." +( + echo '' + echo '' + echo '' + echo '' +) >"${keyfile}" + +echo "Adding key to entity list..." +mv pgpkeys.ent pgpkeys.ent.orig || exit 1 +( + cat pgpkeys.ent.orig + printf '' 16 "${me}" "${keyfile}" +) | sort -u >pgpkeys.ent + +echo +echo "Unless you are already listed there, you should now add the" +echo "following text to chapter.sgml in the appropriate position in" +echo "the developer section (unless this is a role key or you are a" +echo "core member.) Remember to keep the list sorted by last name!" +echo +echo " " +echo " &a.${me};" +echo " &pgpkey.${me};" +echo " " +echo +echo "Don't forget to 'cvs add ${keyfile}' if this is a new entry," +echo "and check your diffs before committing!" Index: pgpkeys/pgpkeys.ent =================================================================== RCS file: pgpkeys/pgpkeys.ent diff -N pgpkeys/pgpkeys.ent --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pgpkeys/pgpkeys.ent 22 Jan 2002 09:46:41 -0000 @@ -0,0 +1 @@ + --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message