]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
make.sh: Enable the timer conditionally
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 16 Jun 2026 11:17:53 +0000 (11:17 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 16 Jun 2026 11:17:53 +0000 (11:17 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index 4b70e15ad6d9f11fd35b5e1761cd3f654624b391..cfcbb763575af0c1cc5fd4d8192d8b525d4ef98d 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -527,6 +527,7 @@ execute() {
        local command=()
        local interactive="false"
        local network="false"
+       local timer="false"
 
        # Collect environment variables
        local -A environ=(
@@ -685,6 +686,10 @@ execute() {
                                )
                                ;;
 
+                       --timer)
+                               timer="true"
+                               ;;
+
                        -*)
                                echo "Unknown argument: ${1}" >&2
                                return 2
@@ -823,7 +828,9 @@ execute() {
                        done
 
                        # Print the total runtime
-                       print_runtime "$(( SECONDS - t ))"
+                       if [ "${timer}" = "true" ]; then
+                               print_runtime "$(( SECONDS - t ))"
+                       fi
        esac
 
        return "${r}"
@@ -875,7 +882,7 @@ lfsmake1() {
                exiterror "Downloading ${pkg}"
        fi
 
-       if ! make_pkg "${pkg}" TOOLCHAIN=1 ROOT="${BUILD_DIR}" b2 install "$@"; then
+       if ! make_pkg --timer "${pkg}" TOOLCHAIN=1 ROOT="${BUILD_DIR}" b2 install "$@"; then
                print_status FAIL
 
                exiterror "Building ${pkg}"
@@ -917,7 +924,7 @@ lfsmake2() {
        fi
 
        # Run install on the package
-       if ! make_pkg --chroot "${args[@]}" "${pkg}" b2 install "$@"; then
+       if ! make_pkg --chroot --timer "${args[@]}" "${pkg}" b2 install "$@"; then
                print_status FAIL
 
                exiterror "Building ${pkg}"
@@ -935,7 +942,7 @@ ipfiredist() {
        [ $? == 1 ] && return 0
 
        # Run dist on the package
-       if ! make_pkg --chroot "${pkg}" dist "$@"; then
+       if ! make_pkg --chroot --timer "${pkg}" dist "$@"; then
                print_status FAIL
 
                exiterror "Packaging ${pkg}"