From d1790c295a054982734aa9b1b3eb4f7d4de234f6 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Fri, 10 May 2024 21:22:23 +0200 Subject: fix(version): escape pkgbase in nvchecker toml This fixes issues with packages containing plus signs, that need to be escaped in toml as well as the extended grep regex. Component: pkgctl version check --- src/lib/version/check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/version/check.sh') diff --git a/src/lib/version/check.sh b/src/lib/version/check.sh index 27509a6..0449c60 100644 --- a/src/lib/version/check.sh +++ b/src/lib/version/check.sh @@ -267,13 +267,13 @@ nvchecker_check_config() { done # check if the config contains a pkgbase section - if [[ -n ${pkgbase} ]] && ! grep --max-count=1 --extended-regexp --quiet "^\\[\"?${pkgbase}\"?\\]" < "${config}"; then + if [[ -n ${pkgbase} ]] && ! grep --max-count=1 --extended-regexp --quiet "^\\[\"?${pkgbase//+/\\+}\"?\\]" < "${config}"; then printf "missing pkgbase section in %s: %s" "${config}" "${pkgbase}" return 1 fi # check if the config contains any section other than pkgbase - if [[ -n ${pkgbase} ]] && property=$(grep --max-count=1 --perl-regexp "^\\[(?!\"?${pkgbase}\"?\\]).+\\]" < "${config}"); then + if [[ -n ${pkgbase} ]] && property=$(grep --max-count=1 --perl-regexp "^\\[(?!\"?${pkgbase//+/\\+}\"?\\]).+\\]" < "${config}"); then printf "non-pkgbase section not supported in %s: %s" "${config}" "${property}" return 1 fi -- cgit v1.2.3-70-g09d2