From d8f6cd5f88228dfd8ddbe501e980cc66c88d5742 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 25 Jul 2018 15:01:05 +0200 Subject: lib/common-functions: find_repository_with_commit(): do not exit!=0, but return!=0 on error --- lib/common-functions | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/common-functions b/lib/common-functions index 45438cd..6cf0231 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -80,7 +80,7 @@ find_repository_with_commit() { fi done >&2 printf 'find_repository_with_commit: Cannot find repository with commit "%s"\n' "$1" - exit 1 + return 2 } @@ -311,13 +311,14 @@ make_source_info() { local PKGBUILD local PKGBUILD_mod - git_repo=$(find_repository_with_commit "${git_revision}") - - if [ -z "${git_repo}" ]; then + if ! git_repo=$(find_repository_with_commit "${git_revision}") || \ + [ -z "${git_repo}" ]; then return 1 fi - find_pkgbuilds "${package}" "${repository}" "${git_repo}" "${git_revision}" "${mod_git_revision}" + if ! find_pkgbuilds "${package}" "${repository}" "${git_repo}" "${git_revision}" "${mod_git_revision}"; then + return 1 + fi ( # the new shell is intentional -- cgit v1.2.3-54-g00ecf