From fb2c127e81b915f4bd1d0a3a8b56dd1e083ba375 Mon Sep 17 00:00:00 2001 From: Angelica Date: Mon, 9 Sep 2024 17:18:00 -0400 Subject: [PATCH 1/6] Uses the '-quiet' flag on mksquashfs if the grep cmd is able to find the '-quiet' flag in the mksquashfs help menu, meaning that mksquashf is version 4.4 or higher. --- bin/ch-convert | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/ch-convert b/bin/ch-convert index 103310e6c..34dc47aa9 100755 --- a/bin/ch-convert +++ b/bin/ch-convert @@ -116,8 +116,13 @@ cv_dir_squash () { # Exclude build cache metadata. 64kiB block size based on Shane’s # experiments. # shellcheck disable=SC2086 - quiet mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ + if mksquashfs --help 2>&1 | grep "quieti"; then + mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ + -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle -quiet + else + quiet mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle + fi # 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/ From c3d051610e448cf5f7c196f47ce1900f8949f5e6 Mon Sep 17 00:00:00 2001 From: Angelica <67800009+alstar555@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:30:34 -0400 Subject: [PATCH 2/6] Removed typo in quiet --- bin/ch-convert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ch-convert b/bin/ch-convert index 34dc47aa9..a295c0f46 100755 --- a/bin/ch-convert +++ b/bin/ch-convert @@ -116,7 +116,7 @@ cv_dir_squash () { # Exclude build cache metadata. 64kiB block size based on Shane’s # experiments. # shellcheck disable=SC2086 - if mksquashfs --help 2>&1 | grep "quieti"; then + if mksquashfs --help 2>&1 | grep "quiet"; then mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle -quiet else From a47f54c9616905d38df5159a3c161c9519d26d5d Mon Sep 17 00:00:00 2001 From: Angelica Date: Mon, 9 Sep 2024 17:18:00 -0400 Subject: [PATCH 3/6] Removed trailing whitespaces --- bin/ch-convert | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/ch-convert b/bin/ch-convert index a295c0f46..774d51fe7 100755 --- a/bin/ch-convert +++ b/bin/ch-convert @@ -116,12 +116,19 @@ cv_dir_squash () { # Exclude build cache metadata. 64kiB block size based on Shane’s # experiments. # shellcheck disable=SC2086 +<<<<<<< HEAD if mksquashfs --help 2>&1 | grep "quiet"; then mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle -quiet +======= + 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 +>>>>>>> 613e545 (Removed trailing whitespaces) else - quiet mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ - -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle + mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ + -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle fi # 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 From af1532b520e8262eea995eb07b2ec5a7cdd36f37 Mon Sep 17 00:00:00 2001 From: Angelica Date: Mon, 9 Sep 2024 21:04:45 -0400 Subject: [PATCH 4/6] Fixed git commit mistake --- bin/ch-convert | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bin/ch-convert b/bin/ch-convert index 774d51fe7..c76ac7b79 100755 --- a/bin/ch-convert +++ b/bin/ch-convert @@ -116,16 +116,10 @@ cv_dir_squash () { # Exclude build cache metadata. 64kiB block size based on Shane’s # experiments. # shellcheck disable=SC2086 -<<<<<<< HEAD - if mksquashfs --help 2>&1 | grep "quiet"; then - mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ - -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle -quiet -======= 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 ->>>>>>> 613e545 (Removed trailing whitespaces) else mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \ -pf "$pflist" -e "$1"/ch/git -e "$1"/ch/git.pickle From 80021968b17c578c303ba44443e5ffa0a1de19db Mon Sep 17 00:00:00 2001 From: Angelica Date: Thu, 12 Sep 2024 14:18:28 -0400 Subject: [PATCH 5/6] 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/ From 847020edf76f887eab73075f16a8d51a324eb4c2 Mon Sep 17 00:00:00 2001 From: Angelica Date: Thu, 12 Sep 2024 14:46:34 -0400 Subject: [PATCH 6/6] Fixed grep syntax to pass test checks --- bin/ch-convert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ch-convert b/bin/ch-convert index 0470a1f01..42d12dac0 100755 --- a/bin/ch-convert +++ b/bin/ch-convert @@ -117,7 +117,7 @@ cv_dir_squash () { # experiments. # shellcheck disable=SC2086 q= - if mksquashfs --help 2>&1 | egrep -q '^-quiet'; then + if mksquashfs --help 2>&1 | grep -qE '^-quiet'; then q=-quiet fi quiet mksquashfs "$1" "$2" $squash_xattr_arg -b 65536 -noappend -all-root \