2023-07-15 14:29:52 +00:00
|
|
|
#!/bin/bash
|
2023-10-23 22:44:47 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2023-07-15 14:29:52 +00:00
|
|
|
|
|
|
|
###
|
|
|
|
### A simple loop to allow running commands against all projects/devices/architectures.
|
|
|
|
###
|
|
|
|
|
|
|
|
COMMAND="$*"
|
|
|
|
|
|
|
|
for PROJECT in $(find projects/ -mindepth 1 -maxdepth 1 -type d)
|
|
|
|
do
|
|
|
|
export PROJECT="$(basename ${PROJECT})"
|
|
|
|
for DEVICE in $(find projects/${PROJECT}/devices/ -mindepth 1 -maxdepth 1 -type d)
|
|
|
|
do
|
|
|
|
export DEVICE="$(basename ${DEVICE})"
|
|
|
|
for ARCH in $(find projects/${PROJECT}/devices/${DEVICE}/linux -name linux* -type f)
|
|
|
|
do
|
|
|
|
export ARCH="$(basename ${ARCH} | awk 'BEGIN {FS="."} {print $2}')"
|
|
|
|
echo -e "\n${PROJECT}/${DEVICE}/${ARCH}: Run \`${COMMAND}\`"
|
2023-07-15 15:50:50 +00:00
|
|
|
eval "${COMMAND}"
|
2023-07-15 15:28:28 +00:00
|
|
|
if [ ! "$?" = "0" ]
|
|
|
|
then
|
|
|
|
echo "Command failed, aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-07-15 14:29:52 +00:00
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
unset PROJECT DEVICE ARCH
|