commit:     f8f4910895ec20028da12e4e50ccdc98d7658c30
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Tue Jun 17 23:12:48 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 17 23:40:48 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f8f49108

emerge-webrsync: always pass --fail and --show-error to curl(1)

Presently, the fetch_file() function extends the value of 'FETCHCOMMAND'
with the -f (--fail) option, but only where both of the following
conditions hold true:

1) curl(1) has been detected as the user-agent to be executed
2) the user passed the --quiet option to emerge-webrsync

The second of these conditions is inappropriate because -f affects how
curl(1) chooses its exit status value. In particular, the option ensures
that it exits with a status other than zero in the event that the HTTP
server responds with a code between 400 and 499. This behaviour is
useful for scripting purposes and should not be contingent upon whether
the user has requested for emerge-webrsync to be quiet.

Address this issue by ensuring that curl(1) is given both the -f and -S
(--show-error) options, unconditionally. The latter option prevents the
-s option from suppressing all diagnostics in the event of an error.

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

 bin/emerge-webrsync | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 6d6dd254e9..f0637c2258 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -224,9 +224,9 @@ fetch_file() {
                        fi
                        ;;
                *curl*)
-                       opts="--continue-at"
+                       opts="--continue-at -f -S"
                        if (( opt[quiet] )); then
-                               opts+=" -s -f"
+                               opts+=" -s"
                        fi
                        ;;
                *)

Reply via email to