libreboot

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 2628a25901d35bd267fba945100864578f920770
parent eea45e77dc0eb2f477e911a590c35d5f2275b1a6
Author: Francis Rowe <info@gluglug.org.uk>
Date:   Thu, 10 Mar 2016 19:19:57 +0000

build: re-introduce variable names for $1 and $2

This is necessary, so that we can use "shift 2", so that additional
parameters can be added which are passed to the scripts that the build script
then calls.

Diffstat:
build | 23+++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/build b/build @@ -63,25 +63,28 @@ if [ ${#} -eq 0 ] || [ ${#} -ge 4 ]; then die "Wrong number of arguments specified. See './build help'." fi +mode="${1}" +option="${2}" +shift 2 -[ "${1}" = help ] && help && exit 0 +[ "${mode}" = help ] && help && exit 0 -case "${2}" in +case "${option}" in list) - printf "Available options for mode '%s':\n\n" "${1}" - listoptions "${1}" + printf "Available options for mode '%s':\n\n" "${mode}" + listoptions "${mode}" ;; all) - for option in $(listoptions "${1}"); do - "${build}"/"${1}"/"${2}" "$@" + for option in $(listoptions "${mode}"); do + "${build}"/"${mode}"/"${option}" "$@" done ;; *) - if [ -d "${build}"/"${1}"/ ]; then - if [ -f "${build}"/"${1}"/"${2}" ]; then - "${build}"/"${1}"/"${2}" "$@" + if [ -d "${build}"/"${mode}"/ ]; then + if [ -f "${build}"/"${mode}"/"${option}" ]; then + "${build}"/"${mode}"/"${option}" "$@" else - die "Invalid option for '${1}'. See './build ${1} list'." + die "Invalid option for '${mode}'. See './build ${mode} list'." fi else die "Invalid mode. See './build help'."