commit: 2818148532b36d5f5c919b8bf9e13ccd2bdbb5a1
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Thu Jun 26 04:40:30 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 28 02:30:17 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=28181485
misc-function.sh: check for tar --xattrs support in a quieter way
Presently, the __dyn_package() function employs the combination of a
conditional expression and a command substitution to test whether tar(1)
supports the --xattrs option. However, should the xtrace shell option
happen to be enabled, the captured output of tar --help will be shown in
its entirety, which is somewhat grating. Address this issue by instead
using grep(1) to match against the output stream of tar(1).
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/misc-functions.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 9ffe2274fc..d414e11f8f 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -538,7 +538,7 @@ __dyn_package() {
[[ ${PORTAGE_VERBOSE} = 1 ]] && tar_options+=" -v"
if contains_word xattr "${FEATURES}" \
- && [[ $(tar --help 2>/dev/null) == *--xattrs* ]]
+ && tar --help 2>/dev/null | grep -q -- --xattrs
then
tar_options+=" --xattrs"
fi