commit:     e1d973f18e4836665eda914665c6d20c1c196b33
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Nov 10 17:24:03 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 10 18:09:15 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e1d973f1

ecompress: enhance the diagnostics where PORTAGE_COMPRESS is set as "true"

Some define PORTAGE_COMPRESS as "true" or ":" to inhibit compression but
the correct way to go about it is to define the compressor as the empty
string. For such cases, refine the exception message so that users may
better understand its ramifications.

ecompress: failed to determine the suffix of archives created by 'true'
(to disable compression, set PORTAGE_COMPRESS="" instead)

See-also: please insert commit id for make.conf(5) update here
See-also: 3483b585a0d416ab345666b885e325bbfaf231bf
See-also: 3498e0f1c1fe6c7f23707d0e56462fbc8dfb487d
Closes: https://bugs.gentoo.org/965903
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ecompress | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/ecompress b/bin/ecompress
index 4aa0363f26..81e4dfee6f 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -253,7 +253,11 @@ fi
 
 # figure out the new suffix
 if ! PORTAGE_COMPRESS_SUFFIX=$(guess_suffix); then
-       die "Failed to determine the suffix of archives created by 
${PORTAGE_COMPRESS@Q}"
+       error="${0##*/}: failed to determine the suffix of archives created by 
${PORTAGE_COMPRESS@Q}"
+       if [[ ${PORTAGE_COMPRESS##*/} == @(true|:) ]]; then
+               error+=' (to disable compression, set PORTAGE_COMPRESS="" 
instead)'
+       fi
+       die "${error}"
 fi
 
 export PORTAGE_COMPRESS_SUFFIX PORTAGE_COMPRESS_FLAGS PORTAGE_COMPRESS

Reply via email to