From: Duncan Burke <[email protected]>

Empty lines were being left in the output of current_keys, which
would break the equality check. This was replaced with sed, which
removes non-matching lines. Unfortunately, gpg -v --list-only does
not support --with-colons, so this still isn't guaranteed to work for
all versions of gpg.

Signed-off-by: Duncan Burke <[email protected]>
---
 src/password-store.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index cf57fd3..a0b8dc3 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -123,7 +123,7 @@ reencrypt_path() {
                        done
                        gpg_keys="$(printf "%s\n" ${gpg_keys[*]} | LC_ALL=C 
sort -u)"
                fi
-               current_keys="$($GPG -v --no-secmem-warning 
--no-permission-warning --list-only --keyid-format long "$passfile" 2>&1 | cut 
-d ' ' -f 5 | LC_ALL=C sort -u)"
+               current_keys="$($GPG -v --no-secmem-warning 
--no-permission-warning --list-only --keyid-format long "$passfile" 2>&1 | sed 
-n "s/^.*public key is \\(.*\\)$/\\1/p" | LC_ALL=C sort -u)"
 
                if [[ $gpg_keys != "$current_keys" ]]; then
                        echo "$passfile_display: reencrypting to 
${gpg_keys//$'\n'/ }"
-- 
2.0.0

_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to