commit:     b098c6cea401512a1ed49213707f301434b1b228
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Jul  4 14:52:09 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 13 04:19:00 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b098c6ce

emerge-webrsync: have fetch_file() require only one argument

Have the fetch_file() function require only one argument by deriving the
values of both the 'URI' and 'FILE' variables from that argument. Doing
so results in a net improvement in code legibility.

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

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

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 1cff334974..c3514bf2ae 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -195,7 +195,7 @@ is_uint() {
 
 fetch_file() {
        # shellcheck disable=2034
-       local URI=$1 FILE=$2
+       local URI=$1 FILE=${1##*/}
 
        if [[ ! ${fetchcommand} ]] && ! fetchcommand=$(get_fetchcommand); then
                die "couldn't parse FETCHCOMMAND"
@@ -499,9 +499,9 @@ do_snapshot() {
                        && have_files=1
 
                        if (( ! have_files )); then
-                               fetch_file "${mirror}/snapshots/${digest}" 
"${digest}" \
-                               && fetch_file 
"${mirror}/snapshots/${signature}" "${signature}" \
-                               && fetch_file "${mirror}/snapshots/${file}" 
"${file}" \
+                               fetch_file "${mirror}/snapshots/${digest}" \
+                               && fetch_file 
"${mirror}/snapshots/${signature}" \
+                               && fetch_file "${mirror}/snapshots/${file}" \
                                && check_file_digest "${DISTDIR}/${file}" \
                                && check_file_signature "${DISTDIR}/${file}" \
                                && have_files=1

Reply via email to