From 4c949dff4dbba4749bbb8f0d2510787c6918c2fc Mon Sep 17 00:00:00 2001
From: ThorstenB <brehmt@gmail.com>
Date: Thu, 18 Aug 2011 20:33:01 +0200
Subject: [PATCH] download_and_compile.sh: ignore errors when creating branches
 Branches may already exist, errors must be properly since the "-e" flag is
 set to abort the script on any errors. Thanks to Francesco for testing.

---
 download_and_compile.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
 mode change 100755 => 100644 download_and_compile.sh

diff --git a/download_and_compile.sh b/download_and_compile.sh
old mode 100755
new mode 100644
index 5354885..60635d2
--- a/download_and_compile.sh
+++ b/download_and_compile.sh
@@ -553,7 +553,7 @@ then
 		then
 			# switch to stable branch
 			# create local stable branch, ignore errors if it exists
-			git branch -f $FGSG_STABLE_GIT_BRANCH origin/$FGSG_STABLE_GIT_BRANCH 2> /dev/null
+			git branch -f $FGSG_STABLE_GIT_BRANCH origin/$FGSG_STABLE_GIT_BRANCH 2> /dev/null || true
 			# switch to stable branch. No error is reported if we're already on the branch.
 			git checkout -f $FGSG_STABLE_GIT_BRANCH
 			# get indicated stable version
@@ -561,7 +561,7 @@ then
 		else
 			# switch to unstable branch
 			# create local unstable branch, ignore errors if it exists
-			git branch -f $FGSG_UNSTABLE_GIT_BRANCH origin/$FGSG_UNSTABLE_GIT_BRANCH 2> /dev/null
+			git branch -f $FGSG_UNSTABLE_GIT_BRANCH origin/$FGSG_UNSTABLE_GIT_BRANCH 2> /dev/null || true
 			# switch to unstable branch. No error is reported if we're already on the branch.
 			git checkout -f $FGSG_UNSTABLE_GIT_BRANCH
 			# pull latest version from the unstable branch
@@ -649,7 +649,7 @@ then
 			then
 				# switch to stable branch
 				# create local stable branch, ignore errors if it exists
-				git branch -f $FGSG_STABLE_GIT_BRANCH origin/$FGSG_STABLE_GIT_BRANCH 2> /dev/null
+				git branch -f $FGSG_STABLE_GIT_BRANCH origin/$FGSG_STABLE_GIT_BRANCH 2> /dev/null || true
 				# switch to stable branch. No error is reported if we're already on the branch.
 				git checkout -f $FGSG_STABLE_GIT_BRANCH
 				# get indicated stable version
@@ -657,7 +657,7 @@ then
 			else
 				# switch to unstable branch
 				# create local unstable branch, ignore errors if it exists
-				git branch -f $FGSG_UNSTABLE_GIT_BRANCH origin/$FGSG_UNSTABLE_GIT_BRANCH 2> /dev/null
+				git branch -f $FGSG_UNSTABLE_GIT_BRANCH origin/$FGSG_UNSTABLE_GIT_BRANCH 2> /dev/null || true
 				# switch to unstable branch. No error is reported if we're already on the branch.
 				git checkout -f $FGSG_UNSTABLE_GIT_BRANCH
 				# pull latest version from the unstable branch
@@ -726,7 +726,7 @@ then
 				then
 					# switch to stable branch
 					# create local stable branch, ignore errors if it exists
-					git branch -f $FGSG_STABLE_GIT_BRANCH origin/$FGSG_STABLE_GIT_BRANCH 2> /dev/null
+					git branch -f $FGSG_STABLE_GIT_BRANCH origin/$FGSG_STABLE_GIT_BRANCH 2> /dev/null || true
 					# switch to stable branch. No error is reported if we're already on the branch.
 					git checkout -f $FGSG_STABLE_GIT_BRANCH
 					# get indicated stable version
@@ -734,7 +734,7 @@ then
 				else
 					# switch to unstable branch
 					# create local unstable branch, ignore errors if it exists
-					git branch -f $FGDATA_UNSTABLE_GIT_BRANCH origin/$FGDATA_UNSTABLE_GIT_BRANCH 2> /dev/null
+					git branch -f $FGDATA_UNSTABLE_GIT_BRANCH origin/$FGDATA_UNSTABLE_GIT_BRANCH 2> /dev/null || true
 					# switch to unstable branch. No error is reported if we're already on the branch.
 					git checkout -f $FGDATA_UNSTABLE_GIT_BRANCH
 					# pull latest version from the unstable branch