From a68025ecf071c13a6523fa5a82e98477c7f84a08 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Mon, 29 Aug 2022 13:33:32 +0200 Subject: [PATCH] FreeBSD-repo.sh: do not exit if grep fails --- packaging/FreeBSD-repo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/FreeBSD-repo.sh b/packaging/FreeBSD-repo.sh index 45722c2..45dcfaf 100755 --- a/packaging/FreeBSD-repo.sh +++ b/packaging/FreeBSD-repo.sh @@ -101,8 +101,8 @@ mv "${TMP}/usr" "${PKG_ROOT}" VERSION=$(jq -r '.version' "${MANIFEST}") # if we've a tagged version (1.5.0), append the number of commits and a dummy hash -VERSION_GOOD=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+$') -VERSION_WITH_COMMIT=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\.g[0-9a-fA-f]\+$') +VERSION_GOOD=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+$') || true +VERSION_WITH_COMMIT=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\.g[0-9a-fA-f]\+$') || true if [ $VERSION_GOOD -eq 0 -a $VERSION_WITH_COMMIT -eq 0 ]; then die "version does not conform to (MAJOR.MINOR.PATCH[.#NUM_COMMITS.g])" fi