From e59cfa5a9891e6d6a0461948971100ee245fb173 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 4 Nov 2015 10:26:23 +0100 Subject: Only download ech key once --- get-signers | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'get-signers') diff --git a/get-signers b/get-signers index 1831686..e9ea32f 100755 --- a/get-signers +++ b/get-signers @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash usage() { @@ -31,12 +31,22 @@ if [ "$#" -eq 0 ]; then exit 1 fi +tmpdir=`mktemp -d` +trap "rm -rf '$tmpdir'" EXIT + keys="$*" gpg --recv-keys $keys while [ "$depth" -gt 0 ]; do - keys=$(gpg --with-colons --fast-list-mode --list-sigs $keys | awk -F ':' '$1 ~ /sig|rev/ {print $5}' | sort -u) - gpg --recv-keys $keys + recv="" + for k in $keys; do + if ! [ -e "$tmpdir/$k" ]; then + recv="$recv $k" + touch "$tmpdir/$k" + fi + done + + gpg --recv-keys $recv depth=$((depth - 1)) done -- cgit v1.2.3