mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
use quotes when checking empty strings in scripts
this is far less error-prone Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -33,8 +33,8 @@ main()
|
||||
esac
|
||||
shift; project="${OPTARG#src/}"; shift
|
||||
done
|
||||
[ -z ${_f} ] && err "flag not specified (-m, -u, -b, -c or -x)"
|
||||
[ -z ${project} ] && err "project name not specified"
|
||||
[ -z "${_f}" ] && err "flag not specified (-m, -u, -b, -c or -x)"
|
||||
[ -z "${project}" ] && err "project name not specified"
|
||||
|
||||
if [ ! -f "config/${project}/build.list" ]; then
|
||||
build_projects $@
|
||||
@@ -80,7 +80,7 @@ build_targets()
|
||||
err "Cannot get options for ${cfgsdir}"
|
||||
[ $# -gt 0 ] && targets=$@
|
||||
|
||||
[ -z ${mode} ] && x_ mkdir -p "${elfdir}/"
|
||||
[ -z "${mode}" ] && x_ mkdir -p "${elfdir}/"
|
||||
|
||||
handle_targets
|
||||
}
|
||||
@@ -97,7 +97,7 @@ handle_targets()
|
||||
done
|
||||
|
||||
[ "${target1}" = "utils" ] && [ "${project}" = "coreboot" ] && return 0
|
||||
[ -z ${mode} ] || return 0
|
||||
[ -z "${mode}" ] || return 0
|
||||
printf "Done! The files are stored under %s/\n\n" "${elfdir}"
|
||||
}
|
||||
|
||||
@@ -138,9 +138,9 @@ handle_src_tree()
|
||||
# Override the above defaults using target.cfg
|
||||
. "${target_dir}/target.cfg" # source
|
||||
|
||||
[ -z ${tree} ] && \
|
||||
[ -z "${tree}" ] && \
|
||||
err "handle_src_tree: ${target_dir}: tree undefined"
|
||||
[ -z ${arch} ] && \
|
||||
[ -z "${arch}" ] && \
|
||||
err "handle_src_tree: ${target_dir}: undefined cpu type"
|
||||
|
||||
codedir="src/${project}/${tree}"
|
||||
@@ -260,7 +260,7 @@ run_make_command()
|
||||
{
|
||||
[ -f "${codedir}/Makefile" ] || [ -f "${codedir}/makefile" ] || \
|
||||
[ -f "${codedir}/GNUmakefile" ] || return 1
|
||||
[ "${project}" = "coreboot" ] && [ -z ${mode} ] && \
|
||||
[ "${project}" = "coreboot" ] && [ -z "${mode}" ] && \
|
||||
x_ printf "%s\n" "${version}" >"${codedir}/.coreboot-version"
|
||||
|
||||
x_ make -C "${codedir}" -j$(nproc) ${mode}
|
||||
|
||||
@@ -66,8 +66,8 @@ fetch_config()
|
||||
err "fetch_config: no \"${cfgsdir}/${_target}/target.cfg\""
|
||||
|
||||
[ "${_target}" != "${tree}" ] && _target="${tree}" && continue
|
||||
[ -z ${tree} ] && err "${_xm}: tree undefined"
|
||||
[ -z ${rev} ] && err "${_xm}: revision undefined"
|
||||
[ -z "${tree}" ] && err "${_xm}: tree undefined"
|
||||
[ -z "${rev}" ] && err "${_xm}: revision undefined"
|
||||
break
|
||||
done
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ create_release_archive()
|
||||
|
||||
fail()
|
||||
{
|
||||
[ -z ${srcdir} ] || rm -Rf "${srcdir}" 1>/dev/null 2>/dev/null || :
|
||||
[ -z "${srcdir}" ] || rm -Rf "${srcdir}" 1>/dev/null 2>/dev/null || :
|
||||
fail "${1}"
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -41,7 +41,7 @@ check_board()
|
||||
if ! check_release "${archive}" ; then
|
||||
[ -f "${rom}" ] || \
|
||||
err "check_board: \"${rom}\" is not a valid path"
|
||||
[ -z ${rom+x} ] && \
|
||||
[ -z "${rom+x}" ] && \
|
||||
err "check_board: no rom specified"
|
||||
[ ! -z ${board+x} ] || \
|
||||
board=$(detect_board "${rom}")
|
||||
@@ -214,7 +214,7 @@ inject_vendorfile_intel_me()
|
||||
printf "adding intel me firmware\n"
|
||||
|
||||
rom="${1}"
|
||||
[ -z ${CONFIG_ME_BIN_PATH} ] && \
|
||||
[ -z "${CONFIG_ME_BIN_PATH}" ] && \
|
||||
err "inject_vendorfile_intel_me: CONFIG_ME_BIN_PATH not set"
|
||||
|
||||
_me_location=${CONFIG_ME_BIN_PATH##*../}
|
||||
@@ -282,7 +282,7 @@ inject_vendorfile_smsc_sch5545_ec()
|
||||
modify_gbe()
|
||||
{
|
||||
printf "changing mac address in gbe to ${new_mac}\n"
|
||||
[ -z ${CONFIG_GBE_BIN_PATH} ] && \
|
||||
[ -z "${CONFIG_GBE_BIN_PATH}" ] && \
|
||||
err "modify_gbe: ${board}: CONFIG_GBE_BIN_PATH not set"
|
||||
|
||||
rom="${1}"
|
||||
|
||||
Reference in New Issue
Block a user