commit:     dddfc74c24bf480cfaa0e47c4eb931da24a9a6d1
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sun Jun 15 21:58:17 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 16 01:16:54 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=dddfc74c

emerge-webrsync: situate the && operator at the front for command chains

As concerns the do_snapshot() function, there are two instances in which
batches of commands are composed by joining them with the && control
operator, such that each is contingent upon the last succeeding. For
both of these instances, have the operators precede the commands rather
than follow them. While only a cosmetic change, it does help to clarify
the control flow.

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

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

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 5613a49574..e024365fa1 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -472,19 +472,18 @@ do_snapshot() {
                        signature="${file}.gpgsig"
 
                        if [[ -s "${DISTDIR}/${file}" && -s 
"${DISTDIR}/${digest}" && -s "${DISTDIR}/${signature}" ]] ; then
-                               check_file_digest "${DISTDIR}/${digest}" 
"${DISTDIR}/${file}" && \
-                               check_file_signature "${DISTDIR}/${signature}" 
"${DISTDIR}/${file}" && \
-                               have_files=1
+                               check_file_digest "${DISTDIR}/${digest}" 
"${DISTDIR}/${file}" \
+                               && check_file_signature 
"${DISTDIR}/${signature}" "${DISTDIR}/${file}" \
+                               && have_files=1
                        fi
 
                        if [[ ${have_files} -eq 0 ]] ; then
-                               fetch_file "${mirror}/snapshots/${digest}" 
"${digest}" && \
-                                       fetch_file 
"${mirror}/snapshots/${signature}" "${signature}" && \
-                                       fetch_file 
"${mirror}/snapshots/${file}" "${file}" && \
-                                       check_file_digest 
"${DISTDIR}/${digest}" "${DISTDIR}/${file}" && \
-                                       check_file_signature 
"${DISTDIR}/${signature}" "${DISTDIR}/${file}" && \
-
-                               have_files=1
+                               fetch_file "${mirror}/snapshots/${digest}" 
"${digest}" \
+                               && fetch_file 
"${mirror}/snapshots/${signature}" "${signature}" \
+                               && fetch_file "${mirror}/snapshots/${file}" 
"${file}" \
+                               && check_file_digest "${DISTDIR}/${digest}" 
"${DISTDIR}/${file}" \
+                               && check_file_signature 
"${DISTDIR}/${signature}" "${DISTDIR}/${file}" \
+                               && have_files=1
                        fi
 
                        #

Reply via email to