[pacman-dev] [PATCH 3/3] makepkg: Making git support do auto-clone/fetch.

John Sumsion john at sumsion.org
Wed Dec 7 19:29:17 EST 2011


>From 4a26847342e3b33217f0682af4e350b71098befe Mon Sep 17 00:00:00 2001
From: John Sumsion <john at sumsion.org>
Date: Sat, 3 Dec 2011 09:36:52 -0700
Subject: [PATCH 3/3] makepkg: Making git support do auto-clone/fetch.

Patterned after the hg logic.

Signed-off-by: John Sumsion <john at sumsion.org>
---
 scripts/makepkg.sh.in |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 8a5eca0..83337fe 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1701,8 +1701,18 @@ devel_check() {
 				return 0
 			fi
 			msg "$(gettext "Determining latest %s revision...")" 'git'
+			if [[ -d ./src/$_gitname ]] ; then
+				cd ./src/$_gitname
+				git remote update
+			else
+				[[ ! -d ./src/ ]] && mkdir ./src/
+				git clone $_gitroot/$_gitname ./src/$_gitname
+				cd ./src/$_gitname
+			fi
 			newpkgver=${_gitref:-origin/master}
+			git reset --hard ${newpkgver}
 			newpkgver=$(git describe --always ${newpkgver} | sed -e 's/-/_/g')
+			cd ../../
 		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"
-- 
1.7.8


More information about the pacman-dev mailing list