commit:     9eea52637a1edd98f6c8fd0d07e6ee8248d8d172
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Tue Jun 17 22:16:39 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 17 23:40:46 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9eea5263

emerge-webrsync: eliminate a novel use of string-replacing expansion

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

 bin/emerge-webrsync | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 82e2dcd6d0..93b1674a86 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -217,13 +217,16 @@ fetch_file() {
        local URI=$1 FILE=$2
        local opts
 
-       if [[ "${FETCHCOMMAND/wget/}" != "${FETCHCOMMAND}" ]]; then
-               opts="--continue $(nvecho -q)"
-       elif [[ "${FETCHCOMMAND/curl/}" != "${FETCHCOMMAND}" ]]; then
-               opts="--continue-at - $(nvecho -s -f)"
-       else
-               rm -f "${DISTDIR}/${FILE}"
-       fi
+       case ${FETCHCOMMAND} in
+               *wget*)
+                       opts="--continue $(nvecho -q)"
+                       ;;
+               *curl*)
+                       opts="--continue-at - $(nvecho -s -f)"
+                       ;;
+               *)
+                       rm -f "${DISTDIR}/${FILE}"
+       esac
 
        einfo "Fetching file ${FILE} ..."
 

Reply via email to