[packages/apache-mod_spdy] use gclient from PATH if available

glen glen at pld-linux.org
Mon Dec 9 21:07:22 CET 2013


commit 82a197412573b5882643f64ffd35224a0321e877
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Dec 9 22:07:16 2013 +0200

    use gclient from PATH if available

 get-source.sh | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)
---
diff --git a/get-source.sh b/get-source.sh
index a4ff804..e0f7423 100755
--- a/get-source.sh
+++ b/get-source.sh
@@ -57,31 +57,36 @@ if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then
 	exit 1
 fi
 
-# http://www.chromium.org/developers/how-tos/install-depot-tools
-test -d depot_tools || {
-	# could also checkout:
-	# svn co http://src.chromium.org/svn/trunk/tools/depot_tools
-	wget -c https://src.chromium.org/svn/trunk/tools/depot_tools.zip
-	unzip -qq depot_tools.zip
-	chmod a+x depot_tools/gclient depot_tools/update_depot_tools
-}
-
 topdir=${PWD:-($pwd)}
-gclient=$topdir/gclient.conf
+
+gclient=$(which gclient 2>/dev/null)
+if [ -z "$gclient" ]; then
+	# http://www.chromium.org/developers/how-tos/install-depot-tools
+	test -d depot_tools || {
+		# could also checkout:
+		# svn co http://src.chromium.org/svn/trunk/tools/depot_tools
+		wget -c https://src.chromium.org/svn/trunk/tools/depot_tools.zip
+		unzip -qq depot_tools.zip
+		chmod a+x depot_tools/gclient depot_tools/update_depot_tools
+	}
+	gclient=$topdir/depot_tools/gclient
+fi
+
+gclientfile=$topdir/gclient.conf
 install -d $package
 cd $package
 
-if [ ! -f $gclient ]; then
+if [ ! -f $gclientfile ]; then
 	# create initial config that can be later modified
-	../depot_tools/gclient config $svnurl --gclientfile=$gclient
+	$gclient config $svnurl --gclientfile=$gclientfile
 fi
 
-cp -p $gclient .gclient
+cp -p $gclientfile .gclient
 
 # emulate gclient config, preserving our deps
 sed -i -re '/"url"/ s,"http[^"]+","'$svnurl'",' .gclient
 
-../depot_tools/gclient sync --nohooks -v
+$gclient sync --nohooks -v
 
 # Populate the LASTCHANGE file template as we will not include VCS info in tarball
 (cd src && svnversion > LASTCHANGE.in)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apache-mod_spdy.git/commitdiff/82a197412573b5882643f64ffd35224a0321e877



More information about the pld-cvs-commit mailing list