Skip site navigation (1)Skip section navigation (2)
Date:      22 Jan 2002 10:23:34 +0100
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        Murray Stokely <murray@freebsd.org>
Cc:        Jun Kuriyama <kuriyama@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: doc/en_US.ISO8859-1/books/handbook/pgpkeys chapter.sgml
Message-ID:  <xzpk7uarb6x.fsf@flood.ping.uio.no>
In-Reply-To: <20020122054120.GT21973@freebsdmall.com>
References:  <200201211616.g0LGGFH54977@freefall.freebsd.org> <xzpg04zs9m9.fsf@flood.ping.uio.no> <20020122054120.GT21973@freebsdmall.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=

Murray Stokely <murray@freebsd.org> writes:
> On Mon, Jan 21, 2002 at 09:59:58PM +0100, Dag-Erling Smorgrav wrote:
> > Things would be so much easier if we just placed the keys in separate
> > files and used <inlinegraphics> to suck them into the SGML code.
>   Or we could just use CDATA sections.

Or we could do both - have them in CDATA sections in separate files.
The advantage to having them in separate files is that chapter.sgml
becomes much easier to navigate, and adding new keys can (almost) be
automated.  Patch attached for your enjoyment (look, Ma, no Perl!)  If
you like this solution, I'll take care of moving those keys already
present out of the SGML file.

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 @@
 <!ENTITY % chap.pgpkeys "IGNORE">
 <!ENTITY % chap.index "IGNORE">
 
+<!ENTITY % pgpkeys SYSTEM "pgpkeys/pgpkeys.ent"> %pgpkeys;
 ]>
 
 <book>
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:13:14 -0000
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+me="$1"
+id="$2"
+gpg=$(which gpg)
+
+if [ -z "${me}" ]; then
+    echo "Usage: addkey <login> [<key-id>]" >/dev/stderr
+    exit 1
+fi
+
+if [ -z "${id}" ]; then
+    id="${me}@freebsd.org"
+fi
+
+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 "${keylist}"
+    echo
+    echo "Multiple keys, please specify key ID on command line." >/dev/stderr
+    exit 1
+fi
+fp=$(gpg --fingerprint "${id}")
+[ $? -eq 0 ] || exit 1
+key=$(gpg --export --armor "${id}")
+[ $? -eq 0 ] || exit 1
+
+keyfile="${me}.key"
+echo "Generating ${keyfile}..."
+(
+    echo '<!-- $FreeBSD$ -->'
+    echo '<!-- Key id:' "${id}" '-->'
+    echo '<programlisting><![CDATA['
+    echo "${fp}"
+    echo ']]></programlisting>'
+    echo '<programlisting role="pgpkey"><![CDATA['
+    echo "${key}"
+    echo ']]></programlisting>'
+) >"${keyfile}"
+
+echo "Adding key to entity list..."
+mv pgpkeys.ent pgpkeys.ent.orig || exit 1
+(
+    cat pgpkeys.ent.orig
+    printf '<!ENTITY pgpkey.%.*s SYSTEM "%s">' 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 "    <sect2>"
+echo "      <title>&a.${me};</title>"
+echo "      &pgpkey.${me};"
+echo "    </sect2>"
+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:13:55 -0000
@@ -0,0 +1 @@
+<!-- $FreeBSD$ -->

--=-=-=--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpk7uarb6x.fsf>