From 28802bcd0b970f30d9cabd771aa8774025c5fea0 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Tue, 19 Nov 2024 02:05:58 +0100 Subject: [PATCH] Fix various things shellcheck complained about --- PKGBUILD | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index c785262..89acdec 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,3 +1,5 @@ +#!/usr/bin/env bash +# shellcheck disable=SC2034 disable=SC2048 disable=SC2086 disable=SC2154 # Maintainer: JeremyStarTM # Maintainer: Josip Ponjavic # Contributor: yarost12 @@ -149,9 +151,9 @@ source=( [[ -n "${_use_llvm_lto}" ]] && BUILD_FLAGS=("LLVM=1" "LLVM_IAS=1") -export KBUILD_BUILD_HOST=archlinux -export KBUILD_BUILD_USER=${pkgbase} -export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" +export "KBUILD_BUILD_HOST=archlinux" +export "KBUILD_BUILD_USER=${pkgbase}" +export "KBUILD_BUILD_TIMESTAMP=$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" # Applies all patches apply_patches() { @@ -176,8 +178,8 @@ apply_patches() { # Copies the kernel config copy_defconfig() { - local _cur_major_ver="$(zcat /proc/config.gz | grep Linux | grep -o '[0-9]*[0-9]\.[0-9]*[0-9]')" - [[ ${_cur_major_ver} != ${_kernel_major} ]] && + local "_cur_major_ver=$(zcat /proc/config.gz | grep Linux | grep -o '[0-9]*[0-9]\.[0-9]*[0-9]')" + [[ "${_cur_major_ver}" != "${_kernel_major}" ]] && warning "Major version was updated, you should regen the defconfig" if [[ -s /proc/config.gz ]]; then @@ -296,6 +298,7 @@ update_defconfig() { [[ -n "$_makenconfig" ]] && make ${BUILD_FLAGS[*]} nconfig # Save configuration + # shellcheck disable=SC2015 [[ -n "${_copyfinalconfig}" ]] && cp -Tf ./.config "${startdir}/kconfig-new" || true } @@ -337,7 +340,7 @@ _package() { install=linux.install cd "${_src_linux}" || exit 1 - local modulesdir="${pkgdir}/usr/lib/modules/$(