]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
make.sh: Allow run_command to execute multiple actions at a time
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 Jul 2024 10:19:33 +0000 (10:19 +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 400f41689a027c5d215a5a39fabde4a085d292a2..0e87b78f0bdb9c46fd6f8644527b3b0fbdbd5c98 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -740,7 +740,7 @@ lfsmake1() {
 
 run_command() {
        local pkg
-       local action
+       local actions=()
 
        local chroot="false"
 
@@ -760,14 +760,9 @@ run_command() {
                                if [ -z "${pkg}" ]; then
                                        pkg="${1}"
 
-                               # Set action
-                               elif [ -z "${action}" ]; then
-                                       action="${1}"
-
-                               # Fail on everything else
+                               # Set actions
                                else
-                                       echo "Unknown argument: ${1}" >&2
-                                       return 2
+                                       actions+=( "${1}" )
                                fi
                                ;;
                esac
@@ -782,7 +777,7 @@ run_command() {
                "-x"
 
                # Run the following command
-               "-c" "cd /usr/src/lfs && make -f ${pkg} LFS_BASEDIR=/usr/src ${action}"
+               "-c" "cd /usr/src/lfs && make -f ${pkg} LFS_BASEDIR=/usr/src ${actions[@]}"
        )
 
        # Run this in chroot?