commit: a6cd1838350d89fdf778b7a1c89f433825f9ca84
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Aug 8 03:00:52 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 5 11:22:07 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6cd1838
ecompress: use test -v instead of ${param+set}
Wherever there is a need to test whether a variable is set, employ the
[[ -v name ]] command to do so. This is supported as of bash-4.2.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/ecompress | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/ecompress b/bin/ecompress
index 620abfdb1a..aa8a3b8076 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -121,7 +121,7 @@ if [[ -z ${PORTAGE_COMPRESS} ]]; then
exit 0
fi
-if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
+if [[ ! -v PORTAGE_COMPRESS_FLAGS ]] ; then
case ${PORTAGE_COMPRESS} in
bzip2|gzip) PORTAGE_COMPRESS_FLAGS="-9";;
# Without setting '-m' lz4 will not compress multiple files at
once.