Package: jetring
Version: 0.12
Severity: wishlist
Tags: patch

The following changes "Action: import" to "Action: import
--import-options=merge-only" for patches that just modify a key, and
introduces a Key-Info: section to make it easier to find a changeset
just by grepping.

For checking keyservers for updated keyrings, this means we then say:

  # save current keyring
  cp $KEYRING ${KEYRING}.old

  # get updated keys safely
  gpg --no-default-keyring --keyring $KEYRING --list-keys --with-colons | 
    grep ^pub: | cut -d: -f5 | sort | 
    xargs -n 15 gpg --no-default-keyring --keyring $KEYRING \
                    --keyserver-options honor-keyserver-url=no \
                    --import-options=merge-only --recv-keys

  # split out the changes
  jetring-gen ${KEYRING}.old $KEYRING

  # commit them
  for x in modify-*; do
    [ -e "$x" ] || continue; # maybe there weren't any changes
    y=$(date +"%Y%m%d")-$x
    mv $x $y
    jetring-accept $JETDIR $y
  done

"modify-0123456789ABCDEF" will get repeated everytime new signatures
get added, so prefixing by date seems a reasonable way of avoiding it.

(I wonder a bit why we went with a signed index instead of having patches
applied in filename order, and all prefixed by a date.)

I wonder if there should be a jetring command that just does the above?
"jetring-update-from-net" or whatever.

--- jetring-gen 2007-12-10 03:04:01.000000000 +1000
+++ jetring-gen 2008-04-06 23:31:57.000000000 +1000
@@ -29,17 +29,20 @@
        if (/-pub:/) {
                genchangeset("delete-$fields[4]",
                        "delete-key $fields[4]",
-                       "y");
+                       "y",
+                       getlistkey($fields[4], $old));
        }
        elsif (/\+pub:/) {
                genchangeset("add-$fields[4]",
                        "import",
-                       getkey($fields[4]));
+                       getkey($fields[4]),
+                       getlistkey($fields[4]));
        }
        elsif (/ pub/) {
                genchangeset("modify-$fields[4]",
-                       "import",
-                       getkey($fields[4]));
+                       "import --import-options=merge-only",
+                       getkey($fields[4]),
+                       getlistkey($fields[4]));
        }
 }
 close DIFF;
@@ -48,6 +51,12 @@
        my $fn=shift;
        my $action=shift;
        my $data=shift;
+       my $desc=shift;
+
+       chomp($desc);
+       $desc=~s/^$/./mg;
+       $desc=~s/^/  /mg;
+       chomp($desc);
 
        if ($data=~/\n/) {
                $data=~s/^/  /mg;
@@ -59,6 +68,8 @@
 Comment: $comment
 Date: $date
 Action: $action
+Key-Info:
+$desc
 Data: $data
 EOF
        close OUT;
@@ -66,6 +77,13 @@
        print "$fn\n";
 }
 
+sub getlistkey {
+       my $id=shift;
+       my $kr=shift || $new;
+       my $listkey=`gpg --no-auto-check-trustdb --option /dev/null 
--no-default-keyring --keyring "$kr" --list-keys "$id"`;
+       return $listkey;
+}
+
 sub getkey {
        my $id=shift;
        my $key=`gpg --no-auto-check-trustdb --options /dev/null 
--no-default-keyring --keyring "$new" -a --export "$id"`;



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to