diff options
author | Leah Rowe <leah@libreboot.org> | 2023-12-16 07:56:26 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-12-16 07:56:26 +0000 |
commit | 1eb4df6748f94a08d44c623a56417199b99b371d (patch) | |
tree | e45f8b519cfe1e22dda8ef18763f8ae3546c477f /script/update | |
parent | 54ca5f24d20531ac728a9475a94912f0a08f29f7 (diff) |
fix several shellcheck warnings
lbmk didn't quote certain arguments in commands, or
used ! -z instead of -n, things like that. simple fixes.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/update')
-rwxr-xr-x | script/update/release | 12 | ||||
-rwxr-xr-x | script/update/trees | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/script/update/release b/script/update/release index 447d93ce..7dafbe32 100755 --- a/script/update/release +++ b/script/update/release @@ -209,12 +209,12 @@ nukerom() touch "${romdir}/vendorhashes" || err "!touch ${romdir}/vendorhashes" ( cd "${romdir}" || err "!cd romdir ${romdir}, nukerom" - sha512sum *.rom >> vendorhashes || err "!create vendorhashes, nukerom" + sha512sum ./*.rom >> vendorhashes || err "!create vendorhashes, nukerom" ) || err "can't create vendor hashes" for romfile in "${romdir}"/*.rom; do [ -f "${romfile}" ] || continue - ./vendor inject -r "${romfile}" -b ${target} -n nuke || \ + ./vendor inject -r "${romfile}" -b "${target}" -n nuke || \ err "!vendor inject (nuke) ${romfile}, nukerom" done } @@ -255,13 +255,13 @@ mkrom_tarball() f="release/${version}/roms/${archivename}" mkdir -p "${f%/*}" || err "mkrom_tarball: !mkdir -p ${f%/*}" ( - cd "${romdir%/bin/${target}}" || err "!cd ${romdir%/bin/${target}}" + cd "${romdir%"/bin/${target}"}" || err "!cd ${romdir%"/bin/${target}"}" mktarball "bin/${target}" "${archivename}.tar.xz" ) || err "can't create rom tarball" - mv "${romdir%/bin/${target}}/${archivename}.tar.xz"* "${f%/*}" || \ - err "!mktarball, rom, ${f%/*}/${romdir%/bin/${target}}/${archivename}.tar.xz" + mv "${romdir%"/bin/${target}"}/${archivename}.tar.xz"* "${f%/*}" || \ + err "!mktarball, rom, ${f%/*}/${romdir%"/bin/${target}"}/${archivename}.tar.xz" - printf "Created ROM archive: ${f%/*}/${archivename}.tar.xz" + printf "Created ROM archive: %s" "${f%/*}/${archivename}.tar.xz" } insert_version_files() diff --git a/script/update/trees b/script/update/trees index 1719aab9..0810c625 100755 --- a/script/update/trees +++ b/script/update/trees @@ -99,7 +99,7 @@ handle_targets() target="${x}" printf "Running 'make %s' for project '%s, target '%s''\n" \ "${mode}" "${project}" "${target}" - [ "${project}" != "coreboot" ] || [ ! -z ${mode} ] || \ + [ "${project}" != "coreboot" ] || [ -n "${mode}" ] || \ x_ ./vendor download ${target} x_ handle_defconfig done @@ -121,14 +121,14 @@ handle_defconfig() for y in "${target_dir}/config"/*; do [ -f "${y}" ] || continue config="${y}" - config_name="${config#${target_dir}/config/}" + config_name="${config#"${target_dir}/config/"}" printf "handle/make/config %s %s: handling config %s\n" \ "${project}" "${target}" "${config_name}" - [ ! -z ${mode} ] || check_config || continue + [ -n "${mode}" ] || check_config || continue handle_makefile - [ ! -z ${mode} ] || copy_elf + [ -n "${mode}" ] || copy_elf done } @@ -235,7 +235,7 @@ handle_makefile() { x_ make clean -C "${codedir}" x_ cp "${config}" "${codedir}/.config" - [ ! -z ${mode} ] || make -C "${codedir}" silentoldconfig || \ + [ -n "${mode}" ] || make -C "${codedir}" silentoldconfig || \ make -C "${codedir}" oldconfig || : run_make_command || err "handle_makefile ${codedir}: no makefile!" @@ -256,7 +256,7 @@ run_make_command() [ -f "${codedir}/Makefile" ] || [ -f "${codedir}/makefile" ] || \ [ -f "${codedir}/GNUmakefile" ] || return 1 [ "${project}" = "coreboot" ] && [ -z "${mode}" ] && \ - x_ printf "%s\n" "${version%%-*}" >"${codedir}/.coreboot-version" + x_ printf "%s\n" "${version%%-*}" >"$codedir/.coreboot-version" x_ make ${mode} -j$(nproc) -C "${codedir}" @@ -266,10 +266,10 @@ run_make_command() copy_elf() { - while read f; do + while read -r f; do [ ! -f "${codedir}/$f" ] || \ x_ cp "${codedir}/${f}" "${dest_dir}/" - done < ${listfile} + done < "${listfile}" x_ make clean -C "${codedir}" } |