diff options
author | Matthew Monaco <matthew.monaco@0x01b.net> | 2012-03-13 02:14:20 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-04-07 18:26:16 +0200 |
commit | 0666b1366990064b0f9b47fe321be8e6593336ce (patch) | |
tree | e8a24cd713ea1b8d0d869a23f69d02eb9e7a4ae0 /scripts | |
parent | 80a811ec9641ae0a94a6dcee3dbaeb42afb27afc (diff) | |
download | pacman-0666b1366990064b0f9b47fe321be8e6593336ce.tar.gz pacman-0666b1366990064b0f9b47fe321be8e6593336ce.tar.xz |
makepkg: devel_check(): consolidate common code
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 5e023537..2502e881 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1737,47 +1737,24 @@ devel_check() { return 0 fi + if ! type -p "$vcs" >/dev/null; then + warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "$vcs" "$vcs" + return 0 + fi + + msg "$(gettext "Determining latest %s revision...")" "$vcs" + if [[ -n ${_darcstrunk} && -n ${_darcsmod} ]] ; then - if ! type -p darcs >/dev/null; then - warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "darcs" "darcs" - return 0 - fi - msg "$(gettext "Determining latest %s revision...")" 'darcs' newpkgver=$(date +%Y%m%d) elif [[ -n ${_cvsroot} && -n ${_cvsmod} ]] ; then - if ! type -p cvs >/dev/null; then - warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "cvs" "cvs" - return 0 - fi - msg "$(gettext "Determining latest %s revision...")" 'cvs' newpkgver=$(date +%Y%m%d) elif [[ -n ${_gitroot} && -n ${_gitname} ]] ; then - if ! type -p git >/dev/null; then - warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "git" "git" - return 0 - fi - msg "$(gettext "Determining latest %s revision...")" 'git' newpkgver=$(date +%Y%m%d) elif [[ -n ${_svntrunk} && -n ${_svnmod} ]] ; then - if ! type -p svn >/dev/null; then - warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "svn" "svn" - return 0 - fi - msg "$(gettext "Determining latest %s revision...")" 'svn' newpkgver=$(LC_ALL=C svn info $_svntrunk | sed -n 's/^Last Changed Rev: \([0-9]*\)$/\1/p') elif [[ -n ${_bzrtrunk} && -n ${_bzrmod} ]] ; then - if ! type -p bzr >/dev/null; then - warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "bzr" "bzr" - return 0 - fi - msg "$(gettext "Determining latest %s revision...")" 'bzr' newpkgver=$(bzr revno ${_bzrtrunk}) elif [[ -n ${_hgroot} && -n ${_hgrepo} ]] ; then - if ! type -p hg >/dev/null; then - warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "hg" "hg" - return 0 - fi - msg "$(gettext "Determining latest %s revision...")" 'hg' if [[ -d ./src/$_hgrepo ]] ; then cd ./src/$_hgrepo local ret=0 |