From 9457d6be52e5f409566dabc10dd5435102b2e760 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 27 Aug 2023 14:14:49 +0100 Subject: unified list command for all scripts e.g. ./build boot roms list ./update blobs inject listboards ./build boot list ./build clean list also this is now possible: ./build list or maybe ./update list ^ would list directories in resources/scripts/build and resources/scripts/update respectively this script is added: resources/scripts/build/command/options call it like so, e.g. ./build command options resources/coreboot this script is now used, for list functions in other scripts. Signed-off-by: Leah Rowe --- lbmk | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'lbmk') diff --git a/lbmk b/lbmk index 7cd69ed5..22099e37 100755 --- a/lbmk +++ b/lbmk @@ -48,6 +48,8 @@ main() ./.gitcheck || err "/.gitcheck call from main, in /lbmk" [ "${mode}" = "help" ] && usage ${0} && exit 0 + [ "${mode}" = "list" ] && ./build command options "${buildpath}" && \ + exit 0 [ $# -lt 2 ] && usage ${0} && exit 1 if [ "${mode}" = "dependencies" ]; then @@ -63,10 +65,10 @@ main() case "${option}" in list) - printf "Options for mode '%s':\n\n" ${mode} - listoptions "${mode}" ;; + ./build command options "${buildpath}/${mode}" ;; all) - for option in $(listoptions "${mode}"); do + for option in $(./build command options "${buildpath}/${mode}") + do "${buildpath}/${mode}/${option}" $@ || \ err "script fail: ${buildpath}/${mode}/${option} $@" done @@ -99,19 +101,6 @@ install_dependencies() printf "You must install AUR packages: %s\n" "${aur_notice}" 1>&2 } -# Takes exactly one mode as parameter -listoptions() -{ - options="n" - for option in "${buildpath}/${1}/"*; do - [ -f "${option}" ] || continue - printf '%s\n' ${option##*/} - options="y" - done - [ "${options}" = "y" ] || \ - err "listoptions: No scripts present in directory ${buildpath}/${1}" -} - usage() { progname=${0} @@ -119,7 +108,7 @@ usage() USAGE: ${progname}