From 0a0defd3256ff5e29e3b4d129a04fb7546bc31ac Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 30 Sep 2023 18:41:57 +0100 Subject: simplify initialising variables in shell scripts Signed-off-by: Leah Rowe --- script/update/blobs/inject | 8 ++------ script/update/project/repo | 7 +------ script/update/project/trees | 7 +------ 3 files changed, 4 insertions(+), 18 deletions(-) (limited to 'script/update') diff --git a/script/update/blobs/inject b/script/update/blobs/inject index 01d4cfd6..654af5d3 100755 --- a/script/update/blobs/inject +++ b/script/update/blobs/inject @@ -292,12 +292,10 @@ inject_blob_dell_e6400_vgarom_nvidia() inject_blob_smsc_sch5545_ec() { rom="${1}" - _sch5545ec_location="${CONFIG_SMSC_SCH5545_EC_FW_FILE#../../}" - if [ ! -f "${_sch5545ec_location}" ]; then + [ -f "${_sch5545ec_location}" ] || \ err "inject_blob_smsc_sch5545_ec: SCH5545 fw missing" - fi "${cbfstool}" "${rom}" add -f "${_sch5545ec_location}" \ -n sch5545_ecfw.bin -t raw || \ @@ -307,12 +305,10 @@ inject_blob_smsc_sch5545_ec() modify_gbe() { printf "changing mac address in gbe to ${new_mac}\n" - - rom="${1}" - [ -z ${CONFIG_GBE_BIN_PATH} ] && \ err "modify_gbe: ${board}: CONFIG_GBE_BIN_PATH not set" + rom="${1}" _gbe_location=${CONFIG_GBE_BIN_PATH#../../} [ -f "${_gbe_location}" ] || \ diff --git a/script/update/project/repo b/script/update/project/repo index 4695b52b..c0cec1b6 100755 --- a/script/update/project/repo +++ b/script/update/project/repo @@ -8,13 +8,8 @@ . "include/git.sh" . "include/option.sh" -name="" -rev="" -loc="" -url="" -bkup_url="" +eval "$(setvars "" name rev loc url bkup_url depend)" tmp_dir="${PWD}/tmp/gitclone" -depend="" main() { diff --git a/script/update/project/trees b/script/update/project/trees index 7038cfde..1214ab21 100755 --- a/script/update/project/trees +++ b/script/update/project/trees @@ -11,11 +11,7 @@ set -u -e . "include/git.sh" . "include/option.sh" -_target="" -tree="" -rev="" -project="" -cfgsdir="" +eval "$(setvars "" _target tree rev project cfgsdir)" main() { @@ -40,7 +36,6 @@ main() download_for_target "${x}" || \ err "${project}/${target}: cannot download source tree" done - rm -f "${cfgsdir}"/*/seen || err_rm_seen "main 3" } -- cgit v1.2.1