summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2016-03-10 14:19:57 (EST)
committer Francis Rowe <info@gluglug.org.uk>2016-03-10 14:22:38 (EST)
commit2628a25901d35bd267fba945100864578f920770 (patch)
tree04f8e4154447422f4cc1a615ec4d09e078dd66cb
parenteea45e77dc0eb2f477e911a590c35d5f2275b1a6 (diff)
downloadlibreboot-2628a25901d35bd267fba945100864578f920770.zip
libreboot-2628a25901d35bd267fba945100864578f920770.tar.gz
libreboot-2628a25901d35bd267fba945100864578f920770.tar.bz2
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.
-rwxr-xr-xbuild23
1 files changed, 13 insertions, 10 deletions
diff --git a/build b/build
index f1b9472..069d652 100755
--- 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'."