From c484a55cde24457f6a8f6f581f7502da2f873b30 Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Mon, 29 Apr 2024 14:46:21 +0200 Subject: fix(version): dont die if no PKGBUILD is found So far the commands would stop execution if one of the target directories did not contain a PKGBUILD instead of just reporting failure for that directory. Fix this by replacing the 'die' calls with setting the error for the spinner facility. Component: pkgctl version check Component: pkgctl version upgrade Signed-off-by: Christian Heusel --- src/lib/version/check.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib/version/check.sh') diff --git a/src/lib/version/check.sh b/src/lib/version/check.sh index ec90eb4..27509a6 100644 --- a/src/lib/version/check.sh +++ b/src/lib/version/check.sh @@ -114,10 +114,6 @@ pkgctl_version_check() { fi pushd "${path}" >/dev/null - if [[ ! -f "PKGBUILD" ]]; then - die "No PKGBUILD found for ${path}" - fi - # update the current terminal spinner status (( ++current_item )) pkgctl_version_check_spinner \ @@ -128,6 +124,13 @@ pkgctl_version_check() { "${current_item}" \ "${#pkgbases[@]}" + if [[ ! -f "PKGBUILD" ]]; then + result="${BOLD}${path}${ALL_OFF}: no PKGBUILD found" + failure+=("${result}") + popd >/dev/null + continue + fi + # reset common PKGBUILD variables unset pkgbase pkgname arch source pkgver pkgrel validpgpkeys # shellcheck source=contrib/makepkg/PKGBUILD.proto -- cgit v1.2.3-70-g09d2 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 ++-- src/lib/version/setup.sh | 2 +- 2 files changed, 3 insertions(+), 3 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 diff --git a/src/lib/version/setup.sh b/src/lib/version/setup.sh index 123862c..cdfbeac 100644 --- a/src/lib/version/setup.sh +++ b/src/lib/version/setup.sh @@ -252,7 +252,7 @@ nvchecker_setup() { # escape the section if it contains toml subsection chars section="${pkgbase}" - if [[ ${section} == *.* ]]; then + if [[ ${section} == *.* ]] || [[ ${section} == *+* ]]; then section="\"${section}\"" fi -- cgit v1.2.3-70-g09d2 From 144f9a871ee554b44e1d9733a56d6b4dc99803fe Mon Sep 17 00:00:00 2001 From: David Runge Date: Thu, 6 Jun 2024 16:26:35 +0200 Subject: fix(version): Ignore warnings when nvchecker ignores invalid versions Since version 2.15.1 nvchecker emits a warning for version strings that it consideres invalid (e.g. in the case of PyPI). These warning messages get in the way (the first version emitted via a warning is used as version to compare against) of retrieving the latest version of an upstream and therefore we ignore them. Component: pkgctl version check Signed-off-by: David Runge --- src/lib/version/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/version/check.sh') diff --git a/src/lib/version/check.sh b/src/lib/version/check.sh index 0449c60..4a2b5fa 100644 --- a/src/lib/version/check.sh +++ b/src/lib/version/check.sh @@ -227,7 +227,7 @@ get_upstream_version() { fi if ! output=$(GIT_TERMINAL_PROMPT=0 nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \ - jq --raw-output 'select(.level != "debug")'); then + jq --raw-output 'select((.level != "debug") and (.event != "ignoring invalid version"))'); then printf "failed to run nvchecker: %s" "${output}" return 1 fi -- cgit v1.2.3-70-g09d2