commit: e052b52fc6b7b2e9bba5fb4bfcec463eb324e445
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Jun 7 18:23:44 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 7 22:54:15 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e052b52f
ecompress: render the control flow of fix_symlinks() clear
Clarify the control flow of the fix_symlinks() function by reducing the
extent to which the || control operator is used.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/ecompress | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/bin/ecompress b/bin/ecompress
index e77347eed5..490fd8d345 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -143,10 +143,12 @@ fix_symlinks() {
target1=$(readlink -- "${link}")
target2=${target1}${PORTAGE_COMPRESS_SUFFIX}
- if [[ "${target2}" == /* ]] ; then
- [[ -f "${D%/}${target2}" ]] || continue
- else
- [[ -f "${link%/*}/${target2}" ]] || continue
+ if [[ ${target2} == /* ]]; then
+ if [[ ! -f ${D%/}${target2} ]]; then
+ continue
+ fi
+ elif [[ ! -f ${link%/*}/${target2} ]]; then
+ continue
fi
something_changed=1