From 2112a05dea3c2292b9dc47481aaaa86ad67bb1fe Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 15 Jul 2022 18:07:05 +0200 Subject: [PATCH] modbuild: issues with nounset fixed --- Pmodules/libpbuild.bash | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index 72f3fd3..87e1dc3 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -261,7 +261,7 @@ readonly -f pbuild::supported_compilers # $1: group # pbuild::add_to_group() { - if [[ -z ${1} ]]; then + if (( $# == 0 )); then std::die 42 \ "%s " "${module_name}/${module_version}:" \ "${FUNCNAME}: missing group argument." @@ -385,7 +385,11 @@ pbuild::add_patch() { "%s " "${module_name}/${module_version}:" \ "${FUNCNAME}: missing argument!" PATCH_FILES+=( "$1" ) - PATCH_STRIPS+=( "$2" ) + if (( $# >= 2 )); then + PATCH_STRIPS+=( "$2" ) + else + PATCH_STRIPS+=( "${PATCH_STRIP_DEFAULT}" ) + fi } readonly -f pbuild::add_patch