]> xenbits.xen.org Git - xenclient/build.git/commitdiff
buildroot: Add git pull script.
authorJean Guyader <jean.guyader@eu.citrix.com>
Tue, 17 Nov 2009 16:02:23 +0000 (16:02 +0000)
committerJean Guyader <jean.guyader@eu.citrix.com>
Tue, 17 Nov 2009 16:02:23 +0000 (16:02 +0000)
project/Makefile.in
scripts/git_pull.sh [new file with mode: 0755]

index d615b63194af7d5e9caca3651d9293b70a42c0dd..69c38abfab71d38a2aed85d2b39a46eccff56370 100644 (file)
@@ -99,4 +99,5 @@ VENDOR_PATCH_DIR:=$(strip $(subst ",,$(BR2_VENDOR_PATCH_DIR)))
 #"))
 
 GIT_CHECKOUT="$(BASE_DIR)/scripts/git_checkout.sh"
+GIT_PULL="$(BASE_DIR)/scripts/git_pull.sh"
 
diff --git a/scripts/git_pull.sh b/scripts/git_pull.sh
new file mode 100755 (executable)
index 0000000..492b750
--- /dev/null
@@ -0,0 +1,32 @@
+#! /bin/sh
+
+path="$1"
+
+git_head()
+{
+        ( cd "$path" && git-rev-list HEAD | head -n 1)
+}
+
+
+git_pull()
+{
+        pushd "$path"
+        if [ -d ".git/patches/master" ]; then
+            guilt-pop -a
+            ( cd ".git/patches/master" && git pull)
+        fi
+        
+        git pull
+        
+        [ -d ".git/patches/master" ] && guilt-push -a
+
+        popd
+}
+
+head=`git_head`
+git_pull
+new_head=`git_head`
+
+[ "$head" == "$new_head" ] && exit 0
+
+exit 1