commit:     863dff467848134be0a8d44d3f930900a7d5b896
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed Jun 18 09:46:45 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 18 20:00:58 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=863dff46

emerge-webrsync: clarify behaviour where gemato is missing

Presently, the check_file_signature_gemato() function checks whether
gemato is in PATH. In order to find out what happens if the check fails,
it is necessary to read a comparatively long branch of code. Remedy this
by inverting the sense of the test and making it clear that that
behaviour is to return 127 in that case.

See-also: 7dcae1c07118505a324f1c5d4eb1f37ca9df8999
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index b6b278bff9..90ee167a8e 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -245,7 +245,9 @@ check_file_signature_gemato() {
        local -a gemato_args
        local key
 
-       if type -P gemato > /dev/null; then
+       if ! type -P gemato > /dev/null; then
+               return 127
+       else
                if [[ -n ${PORTAGE_GPG_KEY} ]] ; then
                        key="${PORTAGE_GPG_KEY}"
                else
@@ -278,8 +280,6 @@ check_file_signature_gemato() {
                        # problem).
                        die "signature verification failed"
                fi
-       else
-               return 127
        fi
 }
 

Reply via email to