X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fshare%2Fcommon;h=914fffa5e9536d69365deab301aba75899812b71;hb=585800f161f5cc09ffcb666426691714294cf95e;hp=28da3c09925fc7ccb7487a05c7c5c0e8280fa456;hpb=fd03070ba488f9be9c479734bea9b0f741350221;p=monkeysphere.git diff --git a/src/share/common b/src/share/common index 28da3c0..914fffa 100644 --- a/src/share/common +++ b/src/share/common @@ -530,6 +530,15 @@ gpg2authorized_keys() { ### GPG UTILITIES +# script to determine if gpg version is equal to or greater than specified version +is_gpg_version_greater_equal() { + local gpgVersion=$(gpg --version | head -1 | awk '{ print $3 }') + local latest=$(printf '%s\n%s\n' "$1" "$gpgVersion" \ + | tr '.' ' ' | sort -g -k1 -k2 -k3 \ + | tail -1 | tr ' ' '.') + [[ "$gpgVersion" == "$latest" ]] +} + # retrieve all keys with given user id from keyserver # FIXME: need to figure out how to retrieve all matching keys # (not just first N (5 in this case)) @@ -753,7 +762,7 @@ process_user_id() { } # output all valid keys for specified user ID literal -keys_from_userid() { +keys_for_userid() { local userID local noKey= local nKeys @@ -1168,9 +1177,11 @@ process_authorized_user_ids() { # fingerprints, one per line: list_primary_fingerprints() { local fake=$(msmktempdir) + trap "rm -rf $fake" EXIT GNUPGHOME="$fake" gpg --no-tty --quiet --import GNUPGHOME="$fake" gpg --with-colons --fingerprint --list-keys | \ awk -F: '/^fpr:/{ print $10 }' + trap - EXIT rm -rf "$fake" }