Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: devel_check(): consolidate common code (http://www.linux-archive.org/archlinux-pacman-development/643877-makepkg-devel_check-consolidate-common-code.html)

Matthew Monaco 03-13-2012 12:14 AM

makepkg: devel_check(): consolidate common code
 
From: Matthew Monaco <matthew.monaco@0x01b.net>

---
scripts/makepkg.sh.in | 37 +++++++------------------------------
1 file changed, 7 insertions(+), 30 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 46e787f..74dfd96 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1730,47 +1730,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
--
1.7.9.3


All times are GMT. The time now is 09:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.