diff --git a/doc/makepkg.8.asciidoc b/doc/makepkg.8.asciidoc index cf819b9c..5ba13ace 100644 --- a/doc/makepkg.8.asciidoc +++ b/doc/makepkg.8.asciidoc @@ -363,6 +363,10 @@ On exit, makepkg will return one of the following error codes. 16:: Specified GPG key does not exist or failed to sign package. +17:: + The local repository is not a clone of the source repository + specified in PKGBUILD. + See Also -------- linkman:makepkg.conf[5], linkman:PKGBUILD[5], linkman:pacman[8] diff --git a/scripts/libmakepkg/source/fossil.sh.in b/scripts/libmakepkg/source/fossil.sh.in index 4ffc4a3d..bf2fa53e 100644 --- a/scripts/libmakepkg/source/fossil.sh.in +++ b/scripts/libmakepkg/source/fossil.sh.in @@ -24,6 +24,7 @@ LIBMAKEPKG_SOURCE_FOSSIL_SH=1 MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} +source "$MAKEPKG_LIBRARY/util/error.sh" source "$MAKEPKG_LIBRARY/util/message.sh" source "$MAKEPKG_LIBRARY/util/pkgbuild.sh" @@ -57,7 +58,7 @@ download_fossil() { if ! [[ $(fossil remote -R "$db") = "$url" ]]; then error "$(gettext "%s is not a clone of %s")" "$db" "$url" plainerr "$(gettext "Aborting...")" - exit 1 + exit $E_NOT_A_CLONE_OF fi msg2 "$(gettext "Updating %s %s repo...")" "${repo}" "fossil" if ! fossil pull -R "$db"; then diff --git a/scripts/libmakepkg/source/git.sh.in b/scripts/libmakepkg/source/git.sh.in index 0f835c3c..e8051760 100644 --- a/scripts/libmakepkg/source/git.sh.in +++ b/scripts/libmakepkg/source/git.sh.in @@ -24,6 +24,7 @@ LIBMAKEPKG_SOURCE_GIT_SH=1 MAKEPKG_LIBRARY=${MAKEPKG_LIBRARY:-'@libmakepkgdir@'} +source "$MAKEPKG_LIBRARY/util/error.sh" source "$MAKEPKG_LIBRARY/util/message.sh" source "$MAKEPKG_LIBRARY/util/pkgbuild.sh" @@ -60,7 +61,7 @@ download_git() { if [[ "${url%%.git}" != "${remote_url%%.git}" ]] ; then error "$(gettext "%s is not a clone of %s")" "$dir" "$url" plainerr "$(gettext "Aborting...")" - exit 1 + exit $E_NOT_A_CLONE_OF fi msg2 "$(gettext "Updating %s %s repo...")" "${repo}" "git" if ! git fetch --all -p; then diff --git a/scripts/libmakepkg/util/error.sh.in b/scripts/libmakepkg/util/error.sh.in index 88f87be1..b3def432 100644 --- a/scripts/libmakepkg/util/error.sh.in +++ b/scripts/libmakepkg/util/error.sh.in @@ -39,3 +39,4 @@ E_ALREADY_BUILT=13 E_INSTALL_FAILED=14 E_MISSING_MAKEPKG_DEPS=15 E_PRETTY_BAD_PRIVACY=16 +E_NOT_A_CLONE_OF=17