summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-27 21:46:20 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-27 22:31:24 +0100
commit74c48a881df378a83e261c2785012609d81d801e (patch)
tree52dcd41154762a823bf1d5d06c7a788536aea874 /script
parenta00b43375a7d4a33b6569c0b6ccb9e9291877bb5 (diff)
move build/command/options to include/option.sh
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script')
-rwxr-xr-xscript/build/boot/roms7
-rwxr-xr-xscript/build/command/options30
-rwxr-xr-xscript/handle/make/config3
-rwxr-xr-xscript/update/blobs/inject3
-rwxr-xr-xscript/update/project/trees3
5 files changed, 10 insertions, 36 deletions
diff --git a/script/build/boot/roms b/script/build/boot/roms
index c0c119b5..4b29f78f 100755
--- a/script/build/boot/roms
+++ b/script/build/boot/roms
@@ -9,6 +9,7 @@
set -u -e
. "include/err.sh"
+. "include/option.sh"
read projectname < projectname
opts=""
@@ -23,7 +24,7 @@ main()
firstoption="${1}"
[ "${firstoption}" = "help" ] && usage && exit 0
[ "${firstoption}" = "list" ] && \
- ./build command options config/coreboot && exit 0
+ listitems config/coreboot && exit 0
while [ $# -gt 0 ]; do
case ${1} in
@@ -46,7 +47,7 @@ main()
printf "Building %s ROM images\n" "${projectname}"
if [ "${firstoption}" = "all" ]; then
- for target in $(./build command options config/coreboot); do
+ for target in $(listitems config/coreboot); do
buildrom "${target}" || err "build/roms (1): error"
[ -d "bin/${target}" ] && targets="${target} ${targets}"
done
@@ -81,7 +82,7 @@ usage()
./build boot roms x60 -p grub -d corebootfb -k usqwerty
possible values for 'target':
- $(./build command options "config/coreboot")
+ $(listitems "config/coreboot")
Refer to the ${projectname} documentation for more information.
EOF
diff --git a/script/build/command/options b/script/build/command/options
deleted file mode 100755
index e25daeea..00000000
--- a/script/build/command/options
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env sh
-# SPDX-License-Identifier: MIT
-# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
-
-. "include/err.sh"
-
-items=1
-
-main()
-{
- [ $# -gt 0 ] || \
- err "No argument given"
- listitems "${1}" || err "No items present under: ${1}"
-}
-
-listitems()
-{
- [ -d "${1}" ] || \
- err "Directory not does exist: ${1}"
- for x in "${1}/"*; do
- # -e used because this is for files *or* directories
- [ -e "${x}" ] || continue
- [ "${x##*/}" = "build.list" ] && continue
- printf "%s\n" "${x##*/}" 2>/dev/null
- items=0
- done
- return ${items}
-}
-
-main $@
diff --git a/script/handle/make/config b/script/handle/make/config
index 59b44998..be6f1538 100755
--- a/script/handle/make/config
+++ b/script/handle/make/config
@@ -8,6 +8,7 @@
set -u -e
. "include/err.sh"
+. "include/option.sh"
read projectname < projectname
read our_version < version
@@ -66,7 +67,7 @@ handle_dependencies()
[ -f "${listfile}" ] || fail "list file, ${listfile}, does not exist"
# Build for all targets if no argument is given
- targets=$(./build command options "${cfgsdir}") || \
+ targets=$(listitems "${cfgsdir}") || \
fail "Cannot get options for ${cfgsdir}"
[ $# -gt 0 ] && targets=$@
diff --git a/script/update/blobs/inject b/script/update/blobs/inject
index c2f9ead6..d4a8d1aa 100755
--- a/script/update/blobs/inject
+++ b/script/update/blobs/inject
@@ -7,6 +7,7 @@
. "include/err.sh"
. "include/defconfig.sh"
. "include/blobutil.sh"
+. "include/option.sh"
release_archive="n"
@@ -16,7 +17,7 @@ main()
[ $# -lt 1 ] && err "No options specified."
[ "${1}" = "listboards" ] && \
- ./build command options config/coreboot && exit 0
+ listitems config/coreboot && exit 0
archive="${1}"
diff --git a/script/update/project/trees b/script/update/project/trees
index 084ef1e3..7038cfde 100755
--- a/script/update/project/trees
+++ b/script/update/project/trees
@@ -9,6 +9,7 @@ set -u -e
. "include/err.sh"
. "include/git.sh"
+. "include/option.sh"
_target=""
tree=""
@@ -29,7 +30,7 @@ main()
[ -d "${cfgsdir}" ] || err "unsupported project name"
shift 1
- targets=$(./build command options "${cfgsdir}")
+ targets=$(listitems "${cfgsdir}")
[ $# -gt 0 ] && targets=$@
[ -z "${targets}" ] && \
err "No targets available for project: ${project}"