From 075b11ae4212f51667bda56c9b607dc07ca97620 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 11 Mar 2024 00:34:20 +0100 Subject: [PATCH] Make shellcheck happy --- PKGBUILD | 15 +++++++++------ PKGBUILD.buildtool | 15 +++++++++------ buildtool.sh | 4 +++- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 5775c47..7e9260f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,3 +1,6 @@ +#!/bin/bash +# shellcheck disable=SC2034 disable=SC2154 disable=SC2155 disable=SC2048 disable=SC2086 disable=SC2295 +# ^^^^^ These have been deliberately disabled throughout this entire PKGBUILD, please don't remove them :) # Maintainer: JeremyStarTM # Maintainer: Josip Ponjavic @@ -127,7 +130,7 @@ export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EP prepare() { echo ":: prepare: prepare() called" echo ":: prepare: cding into \"${_srcname}\"" - cd ${_srcname} + cd "${_srcname}" || exit 1 ### Add upstream patches echo ":: prepare: adding upstream patches" @@ -140,8 +143,8 @@ prepare() { ### Add Clear Linux patches echo ":: prepare: patching kernel with Clear Linux patches" - for i in $(grep '^Patch' ${srcdir}/cl-linux/linux.spec |\ - grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do + # shellcheck disable=SC2013 + for i in $(grep '^Patch' "${srcdir}"/cl-linux/linux.spec | grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do if [ -n "$_use_llvm_lto" ]; then if [ "${i}" == "0162-extra-optmization-flags.patch" ] ; then continue @@ -236,7 +239,7 @@ prepare() { build() { echo ":: build: build() called" echo ":: build: cding into \"${_srcname}\"" - cd ${_srcname} + cd "${_srcname}" || exit 1 echo ":: build: starting compilation (make ${BUILD_FLAGS[*]} all)" make ${BUILD_FLAGS[*]} all echo ":: build: build() finished" @@ -254,7 +257,7 @@ _package() { install=linux.install echo ":: _package: cding into \"${_srcname}\"" - cd $_srcname + cd "$_srcname" || exit 1 local modulesdir="$pkgdir/usr/lib/modules/$( # Maintainer: Josip Ponjavic @@ -43,7 +46,7 @@ export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EP prepare() { echo ":: prepare: prepare() called" echo ":: prepare: cding into \"${_srcname}\"" - cd ${_srcname} + cd "${_srcname}" || exit 1 ### Add upstream patches echo ":: prepare: adding upstream patches" @@ -56,8 +59,8 @@ prepare() { ### Add Clear Linux patches echo ":: prepare: patching kernel with Clear Linux patches" - for i in $(grep '^Patch' ${srcdir}/cl-linux/linux.spec |\ - grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do + # shellcheck disable=SC2013 + for i in $(grep '^Patch' "${srcdir}"/cl-linux/linux.spec | grep -Ev '^Patch0132|^Patch0118|^Patch0113|^Patch0138|^Patch0139' | sed -n 's/.*: //p'); do if [ -n "$_use_llvm_lto" ]; then if [ "${i}" == "0162-extra-optmization-flags.patch" ] ; then continue @@ -152,7 +155,7 @@ prepare() { build() { echo ":: build: build() called" echo ":: build: cding into \"${_srcname}\"" - cd ${_srcname} + cd "${_srcname}" || exit 1 echo ":: build: starting compilation (make ${BUILD_FLAGS[*]} all)" make ${BUILD_FLAGS[*]} all echo ":: build: build() finished" @@ -170,7 +173,7 @@ _package() { install=linux.install echo ":: _package: cding into \"${_srcname}\"" - cd $_srcname + cd "$_srcname" || exit 1 local modulesdir="$pkgdir/usr/lib/modules/$(