commit:     4bcb638bb2e250f1954b1e09fe053fae1b92f91b
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 17 06:04:59 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4bcb638b

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: 6edb8eac940f0bdd538a59cc8f1070efba161b53
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 0073cb47b9..1c0f04589a 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -250,7 +250,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