]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
make.sh: Add --quiet to run_command
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 Jul 2024 10:23:45 +0000 (10:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jul 2024 15:39:44 +0000 (15:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index 0e87b78f0bdb9c46fd6f8644527b3b0fbdbd5c98..e263abbe78090cd9fe01d03674abc710cef4c105 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -743,6 +743,7 @@ run_command() {
        local actions=()
 
        local chroot="false"
+       local quiet="false"
 
        while [ $# -gt 0 ]; do
                case "${1}" in
@@ -750,6 +751,10 @@ run_command() {
                                chroot="true"
                                ;;
 
+                       --quiet)
+                               quiet="true"
+                               ;;
+
                        -*)
                                echo "Unknown argument: ${1}" >&2
                                return 2
@@ -798,15 +803,20 @@ run_command() {
                r="$?"
        fi
 
-       # Print the runtime
-       print_runtime "$(( SECONDS - t ))"
+       # Show runtime and status unless quiet
+       case "${quiet}" in
+               false)
+                       # Print the runtime
+                       print_runtime "$(( SECONDS - t ))"
 
-       # All done
-       if [ "${r}" -eq 0 ]; then
-               print_status DONE
-       else
-               print_status FAIL
-       fi
+                       # All done
+                       if [ "${r}" -eq 0 ]; then
+                               print_status DONE
+                       else
+                               print_status FAIL
+                       fi
+                       ;;
+       esac
 
        return "${r}"
 }