summaryrefslogtreecommitdiff
path: root/lib/common-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-07-25 15:01:05 +0200
committerErich Eckner <git@eckner.net>2018-07-25 15:01:05 +0200
commitd8f6cd5f88228dfd8ddbe501e980cc66c88d5742 (patch)
treed2e3a29694acec7ec4f5acfcaadbaa0b25532c86 /lib/common-functions
parent22cd0ae466e2a8423a3942d814750cd7268eb987 (diff)
downloadbuilder-d8f6cd5f88228dfd8ddbe501e980cc66c88d5742.tar.xz
lib/common-functions: find_repository_with_commit(): do not exit!=0, but return!=0 on error
Diffstat (limited to 'lib/common-functions')
-rwxr-xr-xlib/common-functions11
1 files changed, 6 insertions, 5 deletions
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