diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-07-04 18:48:35 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-07-04 18:48:35 +0900 |
commit | cb32298801dc3ba2def4b26d66c65d57dbc99760 (patch) | |
tree | 3855ff3fdc3d046c8838027069a4af3d1b921498 | |
parent | f2514159458c8e92ad058bcca0df8e057d893a84 (diff) | |
download | git-remote-gcrypt-cb32298801dc3ba2def4b26d66c65d57dbc99760.tar.gz |
suppress warning about keyid matching multiple fps
Based on commit a72eb5d9520a8d7fa23478aeb1c14a14e66c19a2 by Raphaël
Droz's fork -- thanks.
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | git-remote-gcrypt | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index 70e64d8..dd41045 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ git-remote-gcrypt (1.0.0-1) UNRELEASED; urgency=medium Thanks Christian Amsüss. (Closes: #827943) * Don't reset the remote ID when a gcrypt remote is not available. Thanks Sebastian Reuße. (Closes: #827943) + * Suppress bogus warning about keyid matching multiple fingerprints. + Based on work by Raphaël Droz. + Closes https://github.com/joeyh/git-remote-gcrypt/pull/2 Debian packaging: * Drop patch containing changes by Joey Hess: incorporated in release. diff --git a/git-remote-gcrypt b/git-remote-gcrypt index 667ab44..61fed76 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -405,7 +405,7 @@ make_new_repo() # $1 return var for goodsig match, $2 return var for signers text read_config() { - local recp_= r_keyinfo= r_keyfpr= gpg_list= cap_= conf_part= good_sig= signers_= + local recp_= r_tail= r_keyinfo= r_keyfpr= gpg_list= cap_= conf_part= good_sig= signers_= Conf_signkey=$(git config --get "remote.$NAME.gcrypt-signingkey" '.+' || git config --path user.signingkey || :) conf_part=$(git config --get "remote.$NAME.gcrypt-participants" '.+' || @@ -428,8 +428,13 @@ read_config() for recp_ in $conf_part do gpg_list=$(rungpg --with-colons --fingerprint -k "$recp_") + r_tail_=$(echo "$recp_" | sed -e 's/^0x//') filter_to @r_keyinfo "pub*" "$gpg_list" - filter_to @r_keyfpr "fpr*" "$gpg_list" + if echo "$recp_" | grep -E -q '^[xA-F0-9]+$'; then # is $recp_ a keyid? + filter_to @r_keyfpr "fpr*$r_tail_*" "$gpg_list" + else + filter_to @r_keyfpr "fpr*" "$gpg_list" + fi isnull "$r_keyinfo" || isnonnull "${r_keyinfo##*"$Newline"*}" || echo_info "WARNING: '$recp_' matches multiple keys, using one" isnull "$r_keyfpr" || isnonnull "${r_keyfpr##*"$Newline"*}" || |