shellcheck fixes

This commit is contained in:
Tobias Powalowski 2023-04-30 17:44:57 +02:00
parent e150850442
commit e1baa7361d
2 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@
# no long options support in archboot
parseopts() {
local opt='' optarg='' i='' shortopts="$1"
local opt='' i='' shortopts="$1"
local -a unused_argv=()
shift
shift
@ -287,7 +287,7 @@ add_file() {
add_file "$srcrealpath" "$srcrealpath" "$mode"
else
if [[ -n $mode ]]; then
command chmod "$mode" ${BUILDROOT}${dest}
command chmod "$mode" "${BUILDROOT}${dest}"
fi
fi
fi
@ -371,7 +371,7 @@ initialize_buildroot() {
}
run_build_hook() {
local hook="$1" script='' resolved=''
local hook="$1" script=''
# shellcheck disable=SC2034
local MODULES=() BINARIES=() FILES=() SCRIPT=''
# find script in install dirs

View file

@ -66,12 +66,12 @@ _prepare_kernel_initramfs_files() {
fi
if [[ -f "./init-${_ARCH}.img" ]]; then
echo "Using existing init-${_ARCH}.img..."
cp ./init-${_ARCH}.img ${_ISODIR}/boot/
cp "./init-${_ARCH}.img" "${_ISODIR}/boot/"
else
echo "Preparing init-${_ARCH}.img..."
archboot-cpio.sh -c "/etc/archboot/${_ARCH}-init.conf" -k "${ALL_kver}" -g "${_ISODIR}/boot/init-${_ARCH}.img" || exit 1
# save init ramdisk for further images
cp ${_ISODIR}/boot/init-${_ARCH}.img ./
cp "${_ISODIR}/boot/init-${_ARCH}.img" ./
fi
echo "Preparing initramfs-${_ARCH}.img..."
#shellcheck disable=SC2154
@ -80,7 +80,7 @@ _prepare_kernel_initramfs_files() {
if grep -qw 'archboot' /etc/hostname; then
if [[ -d "${_CACHEDIR}" ]]; then
echo "Removing ${_CACHEDIR}..."
rm -rf ${_CACHEDIR}
rm -rf "${_CACHEDIR}"
fi
fi
}