chiark / gitweb /
pubkeys: Introduce `pkgf' fallback groups
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Dec 2019 00:18:26 +0000 (00:18 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:49 +0000 (21:56 +0000)
This involves a new directive alias facility.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README.make-secnet-sites
pubkeys.fl.pl

index 4fd594ea539bddeb050aac853ea5031613d85608..579b9a56a74e33d72dd951ffc146fdb1dc7ae972 100644 (file)
@@ -203,7 +203,9 @@ INPUT SYNTAX
                Not yet suported in make-secnet-sites.
 
        pkg GROUPIDHEX
+       pkgf GROUPIDHEX
                Specifies the key group id for subsequent keys.
+               pkgf indicates a fallback group.
                May be repeated (with different id values).
                If not specified, 00000000.
                Not yet suported in make-secnet-sites.
index da22a251e45a6e3427c0195a67546455e5afc7e2..9b6bb9b9ee5a76097ca07a06deefb386a5456496 100755 (executable)
@@ -73,10 +73,15 @@ sub inst ($) {
 
 while (<DATA>) {
     s#\{!2(\w+)\}# '{'.(2 * ($subst{$1}//die "$1 ?")).'}' #ge;
-    if (m/^!KEYWORD ([-0-9a-z]+)(\s*\{.*\})?$/) {
+    if (m/^!(KEYWORD|KWALIAS) ([-0-9a-z]+)(\s*\{.*\})?$/) {
        my $kwt=$2;
-       die if $kw;
-       $kw = $1;
+       if ($1 eq 'KEYWORD') {
+           die if $kw;
+           $kw = $kwt;
+       } else {
+           die if @next_kw;
+           die unless $kw;
+       }
        my $xact = $3 // '';
        $kwid = $kw; $kwid =~ y/-/_/;
        $in_s = "HK_${kwid}";
@@ -193,6 +198,7 @@ static struct pubkeyset_context c[1];
 %%
 
 !KEYWORD pkg  { c->fallback_skip=0; }
+!KWALIAS pkgf { c->fallback_skip=!!c->building->nkeys; }
 !ARG id [0-9a-f]{!2GRPIDSZ} {
     HEX2BIN_ARRAY(c->grpid);
 !}