From 80021968b17c578c303ba44443e5ffa0a1de19db Mon Sep 17 00:00:00 2001 From: Angelica Date: Thu, 12 Sep 2024 14:18:28 -0400 Subject: [PATCH] Syntax fixes in grep and removing redundancy in if statements --- bin/ch-convert | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/ch-convert b/bin/ch-convert index c76ac7b79..0470a1f01 100755 --- a/bin/ch-convert +++ b/bin/ch-convert @@ -116,14 +116,13 @@ cv_dir_squash () { # Exclude build cache metadata. 64kiB block size based on Shane’s # experiments. # shellcheck disable=SC2086 - if mksquashfs --help 2>&1 | grep "quiet"; then - INFO "In quiet" - quiet mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ - -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle -quiet - else - mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ - -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle + q= + if mksquashfs --help 2>&1 | egrep -q '^-quiet'; then + q=-quiet fi + quiet mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ + -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle $q + # Zero the archive’s internal modification time at bytes 8–11, 0-indexed # [1]. Newer SquashFS-Tools ≥4.3 have option “-fstime 0” to do this, but # CentOS 7 comes with 4.2. [1]: https://dr-emann.github.io/squashfs/