gcc-svn-update revision 1.1.1.1.8.2 1 1.1.1.1.8.2 tls #! /bin/bash
2 1.1.1.1.8.2 tls
3 1.1.1.1.8.2 tls # Update or check out GCC sources for a particular Subversion revision
4 1.1.1.1.8.2 tls # and a particular branch.
5 1.1.1.1.8.2 tls #
6 1.1.1.1.8.2 tls # Copyright (C) 2007 Free Software Foundation.
7 1.1.1.1.8.2 tls #
8 1.1.1.1.8.2 tls # This file is free software; you can redistribute it and/or modify
9 1.1.1.1.8.2 tls # it under the terms of the GNU General Public License as published by
10 1.1.1.1.8.2 tls # the Free Software Foundation; either version 3 of the License, or
11 1.1.1.1.8.2 tls # (at your option) any later version.
12 1.1.1.1.8.2 tls #
13 1.1.1.1.8.2 tls # This program is distributed in the hope that it will be useful,
14 1.1.1.1.8.2 tls # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 1.1.1.1.8.2 tls # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 1.1.1.1.8.2 tls # GNU General Public License for more details.
17 1.1.1.1.8.2 tls #
18 1.1.1.1.8.2 tls # For a copy of the GNU General Public License, write the the
19 1.1.1.1.8.2 tls # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 1.1.1.1.8.2 tls # Boston, MA 02111-1301, USA.
21 1.1.1.1.8.2 tls
22 1.1.1.1.8.2 tls #set -ex
23 1.1.1.1.8.2 tls
24 1.1.1.1.8.2 tls if [ $# != 1 ]; then
25 1.1.1.1.8.2 tls echo Usage: $0 id
26 1.1.1.1.8.2 tls exit 1
27 1.1.1.1.8.2 tls fi
28 1.1.1.1.8.2 tls
29 1.1.1.1.8.2 tls if [ "x${REG_DO_CLEANUPS}" != "x" ]; then
30 1.1.1.1.8.2 tls reg_cleanup
31 1.1.1.1.8.2 tls fi
32 1.1.1.1.8.2 tls
33 1.1.1.1.8.2 tls ID=$1
34 1.1.1.1.8.2 tls BRANCH=""
35 1.1.1.1.8.2 tls
36 1.1.1.1.8.2 tls ########################################################################
37 1.1.1.1.8.2 tls # Get sources.
38 1.1.1.1.8.2 tls ########################################################################
39 1.1.1.1.8.2 tls
40 1.1.1.1.8.2 tls svn_get() {
41 1.1.1.1.8.2 tls # In case there are problems with updates (there were with CVS),
42 1.1.1.1.8.2 tls # creating a file called REMOVE in the REG_SRCDIR directory causes us
43 1.1.1.1.8.2 tls # to start with a clean tree each time.
44 1.1.1.1.8.2 tls
45 1.1.1.1.8.2 tls unset LC_ALL
46 1.1.1.1.8.2 tls unset LANG
47 1.1.1.1.8.2 tls
48 1.1.1.1.8.2 tls cd ${REG_SRCDIR}
49 1.1.1.1.8.2 tls if [ -d gcc ]; then
50 1.1.1.1.8.2 tls # There's already a tree; do an update with the new revision.
51 1.1.1.1.8.2 tls cd gcc
52 1.1.1.1.8.2 tls echo "`date` svn update begun for id ${ID}, rev ${REV}"
53 1.1.1.1.8.2 tls echo svn update --non-interactive --revision ${REV} >> $LOG
54 1.1.1.1.8.2 tls svn update --non-interactive --revision ${REV} >> $LOG
55 1.1.1.1.8.2 tls if [ $? -eq 0 ]; then
56 1.1.1.1.8.2 tls echo "`date` svn update done"
57 1.1.1.1.8.2 tls else
58 1.1.1.1.8.2 tls echo "`date` svn update failed"
59 1.1.1.1.8.2 tls exit 1
60 1.1.1.1.8.2 tls fi
61 1.1.1.1.8.2 tls else
62 1.1.1.1.8.2 tls echo "`date` svn checkout begun for id ${ID}, rev ${REV}"
63 1.1.1.1.8.2 tls echo svn checkout --non-interactive --revision ${REV} \
64 1.1.1.1.8.2 tls ${REG_SVN_REPO}/${BRANCHPATH} gcc >> $LOG
65 1.1.1.1.8.2 tls svn checkout --non-interactive --revision ${REV} \
66 1.1.1.1.8.2 tls ${REG_SVN_REPO}/${BRANCHPATH} gcc >> $LOG
67 1.1.1.1.8.2 tls if [ $? -eq 0 ]; then
68 1.1.1.1.8.2 tls echo "`date` svn checkout done"
69 1.1.1.1.8.2 tls else
70 1.1.1.1.8.2 tls echo "`date` svn checkout failed"
71 1.1.1.1.8.2 tls exit 1
72 1.1.1.1.8.2 tls fi
73 1.1.1.1.8.2 tls cd gcc
74 1.1.1.1.8.2 tls fi
75 1.1.1.1.8.2 tls
76 1.1.1.1.8.2 tls # Touch generated files.
77 1.1.1.1.8.2 tls contrib/gcc_update --touch >> $LOG
78 1.1.1.1.8.2 tls }
79 1.1.1.1.8.2 tls
80 1.1.1.1.8.2 tls ########################################################################
81 1.1.1.1.8.2 tls # Main program
82 1.1.1.1.8.2 tls ########################################################################
83 1.1.1.1.8.2 tls
84 1.1.1.1.8.2 tls cd ${REG_SRCDIR}
85 1.1.1.1.8.2 tls
86 1.1.1.1.8.2 tls # This is a simple way to stop a long regression search fairly cleanly;
87 1.1.1.1.8.2 tls # just touch a file called STOP.
88 1.1.1.1.8.2 tls
89 1.1.1.1.8.2 tls if [ -f STOP ]; then
90 1.1.1.1.8.2 tls echo "`date` $0 detected STOP file"
91 1.1.1.1.8.2 tls rm -f STOP
92 1.1.1.1.8.2 tls exit 1
93 1.1.1.1.8.2 tls fi
94 1.1.1.1.8.2 tls
95 1.1.1.1.8.2 tls # Set up the log file.
96 1.1.1.1.8.2 tls REV=`${REG_IDS} -f index -t rev ${ID}`
97 1.1.1.1.8.2 tls LOG=${REG_SRCDIR}/logs/${BUGID}/${REV}.log
98 1.1.1.1.8.2 tls mkdir -p ${REG_SRCDIR}/logs/${BUGID}
99 1.1.1.1.8.2 tls rm -f $LOG
100 1.1.1.1.8.2 tls touch $LOG
101 1.1.1.1.8.2 tls
102 1.1.1.1.8.2 tls # Get the branch for this patch.
103 1.1.1.1.8.2 tls BRANCH=`${REG_IDS} -f index -t branch ${ID}`
104 1.1.1.1.8.2 tls if [ "${BRANCH}" = "error" ]; then
105 1.1.1.1.8.2 tls echo "`date` $0: cannot determine the SVN branch for id ${ID}"
106 1.1.1.1.8.2 tls exit 1
107 1.1.1.1.8.2 tls fi
108 1.1.1.1.8.2 tls
109 1.1.1.1.8.2 tls if [ "${BRANCH}" = "trunk" ]; then
110 1.1.1.1.8.2 tls BRANCHPATH=trunk
111 1.1.1.1.8.2 tls else
112 1.1.1.1.8.2 tls BRANCHPATH=branches/${BRANCH}
113 1.1.1.1.8.2 tls fi
114 1.1.1.1.8.2 tls
115 1.1.1.1.8.2 tls svn_get
116 1.1.1.1.8.2 tls
117 1.1.1.1.8.2 tls exit 0
118