commit: 8f6bf3d321733a0119b4357106a0d5376f881ad4
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Jul 4 14:43:14 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=8f6bf3d3
emerge-webrsync: improve legibility of tests for already-fetched files
Presently, the do_snapshot() function will attempt to make use of a
previously downloaded snapshot tarball in the case that it is found to
exist in the directory specified by the 'DISTDIR' variable, provided
that it is accompanied by its ".md5sum" and ".gpgsig" files. This commit
renders the associated tests more legible.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/emerge-webrsync | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 60b5a3fa96..1cff334974 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -491,11 +491,12 @@ do_snapshot() {
digest="${file}.md5sum"
signature="${file}.gpgsig"
- if [[ -s "${DISTDIR}/${file}" && -s
"${DISTDIR}/${digest}" && -s "${DISTDIR}/${signature}" ]] ; then
- check_file_digest "${DISTDIR}/${file}" \
- && check_file_signature "${DISTDIR}/${file}" \
- && have_files=1
- fi
+ test -s "${DISTDIR}/${file}" \
+ && test -s "${DISTDIR}/${digest}" \
+ && test -s "${DISTDIR}/${signature}" \
+ && check_file_digest "${DISTDIR}/${file}" \
+ && check_file_signature "${DISTDIR}/${file}" \
+ && have_files=1
if (( ! have_files )); then
fetch_file "${mirror}/snapshots/${digest}"
"${digest}" \