summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authoraldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-15 08:35:25 +0000
committeraldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-15 08:35:25 +0000
commit5e9e5d82d33932fc2d2c5d6f03fcec7e33a099d6 (patch)
tree8e9add2a8401af9f5fc85a090a7fb576f55aa3a1 /contrib
parent72350d7baa0fbcf2fcc4aa82bc7d228a7f38734d (diff)
downloadgcc-5e9e5d82d33932fc2d2c5d6f03fcec7e33a099d6.tar.gz
2010-06-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* gcc_update: Support updating a git clone. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160774 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog4
-rwxr-xr-xcontrib/gcc_update31
2 files changed, 34 insertions, 1 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index f03daf82766..5037767c2af 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ * gcc_update: Support updating a git clone.
+
2010-06-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* test_summary: Don't use diff -u.
diff --git a/contrib/gcc_update b/contrib/gcc_update
index 37e65af59c4..cfae86a50c6 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -245,8 +245,13 @@ p
esac
+is_git=0
# Check whether this indeed looks like a local SVN tree.
-if [ ! -d .svn ]; then
+if [ -d .git ]; then
+ GCC_GIT=${GCC_GIT-${GIT-git}}
+ GCC_SVN="true -"
+ is_git=1
+elif [ ! -d .svn ]; then
echo "This does not seem to be a GCC SVN tree!"
exit
fi
@@ -258,6 +263,7 @@ else
set -- $UPDATE_OPTIONS ${1+"$@"}
fi
+if [ $is_git -eq 0 ]; then
chat "Updating SVN tree"
$GCC_SVN ${silent+-q} --non-interactive update ${1+"$@"}
@@ -283,4 +289,27 @@ p
echo "[$branch revision $revision]" > gcc/REVISION
+else
+ chat "Updating GIT tree"
+ $GCC_GIT diff --quiet --exit-code HEAD
+ if [ $? -ne 0 ]; then
+ echo "Attempting to update a dirty git tree!" >&2
+ echo "Commit or stash your changes first and retry." >&2
+ exit 1
+ fi
+ $GCC_GIT pull ${silent+-q} --rebase ${1+"$@"}
+ if [ $? -ne 0 ]; then
+ (touch_files_reexec)
+ echo "git pull of full tree failed." >&2
+ exit 1
+ fi
+ rm -f LAST_UPDATED gcc/REVISION
+ revision=`$GCC_GIT log -n1 --pretty=%p:%t:%H`
+ branch=`$GCC_GIT name-rev --name-only HEAD || :`
+ {
+ date
+ echo "`TZ=UTC date` (revision $revision)"
+ } > LAST_UPDATED
+ echo "[$branch revision $revision]" > gcc/REVISION
+fi
touch_files_reexec