makepkg: make 'not a clone of' visible with a new error code
Add a new error code to expose the 'not a clone of' error state of some source providers (git and fossil). This allows other tools integrating further and handle this specific error state. One usecase evolves around frequently changing source locations in PKGBUILDs of packages in the AUR.
This commit is contained in:
parent
bcd4aad16c
commit
8aba032de4
4 changed files with 9 additions and 2 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue