diff options
Diffstat (limited to 'lbmk')
-rwxr-xr-x | lbmk | 35 |
1 files changed, 6 insertions, 29 deletions
@@ -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} <MODE> <OPTION> possible values for 'mode': - $(listmodes) + $(./build command options "${buildpath}/${mode}") Example: ${progname} module all Example: ${progname} module flashrom [static] @@ -130,16 +119,4 @@ usage() EOF } -listmodes() -{ - modes="n" - for mode in "${buildpath}"/*; do - [ -d "${mode}" ] || continue - printf '%s\n' ${mode##*/} - modes="y" - done - [ "${modes}" = "y" ] || \ - err "listmodes: No directories present in directory ${buildpath}" -} - main $@ |