commit:     2898da9835a939d5561385c24272d98fcbc94bb6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 27 01:51:13 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 27 01:51:13 2026 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-authority-key.git/commit/?id=2898da98

autosign.bash: fix error handling

One needs to use `wait` with read+procsubs (while read < <(...)), it
turns out.

Interestingly, 
https://old.reddit.com/r/bash/comments/m3eh2c/how_to_add_error_handling_to_a_while_loop/
even uses ldap too!

Signed-off-by: Sam James <sam <AT> gentoo.org>

 autosign.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/autosign.bash b/autosign.bash
index 7d8eafb..bf8bc09 100755
--- a/autosign.bash
+++ b/autosign.bash
@@ -67,7 +67,7 @@ get_ldap() {
                                ;;
                esac
        done < <(ldapsearch -Z -D '' -LLL 
"${AUTOSIGN_FILTER:-(gentooStatus=active)}" gpgfingerprint)
-       pipestatus || die "LDAP query failed, exited w/ $?"
+       wait "$!" || die "LDAP query failed, exited w/ $?"
 }
 
 # Get UID-fingerprint list of all currently trusted keys.
@@ -107,7 +107,7 @@ get_signed_keys() {
                                ;;
                esac
        done < <(gpg --batch --with-colons --list-keys)
-       pipestatus || die "gpg query for signed keys failed, exited w/ $?"
+       wait "$!" || die "gpg --list-keys failed, exited w/ $?"
 }
 
 # Revoke the specified UID signature.

Reply via email to