1 | #! /bin/csh |
---|
2 | # |
---|
3 | # GCC snapshot generation script. |
---|
4 | # |
---|
5 | # Originally written by Jeff Law <law@redhat.com>. Most minor modifications |
---|
6 | # by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>. |
---|
7 | |
---|
8 | # TODO: Include the FAQ and installation instructions in the snapshot |
---|
9 | |
---|
10 | set SCRIPTDIR=/home/law/gcc |
---|
11 | set STATEDIR=/home/law |
---|
12 | set TMPDIR=/var/tmp |
---|
13 | |
---|
14 | set path = (/usr/local/bin $path) |
---|
15 | |
---|
16 | # Get somewhere useful with a lot of disk space. |
---|
17 | cd $TMPDIR |
---|
18 | |
---|
19 | # Get date of current and previous snapshot. |
---|
20 | set date=`date +%Y%m%d` |
---|
21 | set last_date=`cat $STATEDIR/.snapshot_date` |
---|
22 | set snapdir=`date +%Y-%m-%d` |
---|
23 | |
---|
24 | # Update and uncomment the following lines to run a particular snapshot pair. |
---|
25 | #set date=971215 |
---|
26 | #set last_date=19990920 |
---|
27 | |
---|
28 | # We run this on the cvs server itself so we can get at |
---|
29 | # the cvs files quickly. |
---|
30 | setenv CVSROOT /cvs/gcc |
---|
31 | |
---|
32 | # Get into a temporary directory so as not to be confused by |
---|
33 | # any existing CVS administration files. |
---|
34 | rm -rf $$ |
---|
35 | mkdir $$ |
---|
36 | cd $$ |
---|
37 | |
---|
38 | # Tag the current sources for the snapshot |
---|
39 | cvs -z 9 -Q rtag -F gcc_ss_$date gcc |
---|
40 | |
---|
41 | # Get an exported copy of the last gcc-core module snapshot |
---|
42 | # arggh gcc-core doesn't work right now, so check out the whole |
---|
43 | # thing and remove bits we don't need. |
---|
44 | #zcat ~ftp/pub/gcc/snapshots/1998-05-31/gcc-$last_date.tar.gz | tar xf - |
---|
45 | cvs -z 9 -Q export -rgcc_ss_$last_date gcc |
---|
46 | cd gcc |
---|
47 | find . -type f -print | sort > ../files_$last_date |
---|
48 | ~law/bin/brik -Gb -f ../files_$last_date > ../.brik_$last_date |
---|
49 | cp ../.brik_$last_date ./.brik |
---|
50 | cd .. |
---|
51 | rm -rf gcc/{libio,libstdc++,libstdc++-v3,libf2c,libchill,libobjc} |
---|
52 | rm -rf gcc/{boehm-gc,fastjar,libffi,libjava,zlib} |
---|
53 | rm -rf gcc/gcc/{testsuite,f,objc,cp,java,ch} |
---|
54 | mv gcc gcc-$last_date |
---|
55 | |
---|
56 | # Similarly for today's gcc-core module snapshot |
---|
57 | cvs -z 9 -Q export -rgcc_ss_$date gcc |
---|
58 | cd gcc |
---|
59 | contrib/gcc_update --touch |
---|
60 | find . -type f -print | sort > ../files_$date |
---|
61 | ~law/bin/brik -Gb -f ../files_$date > ../.brik_$date |
---|
62 | cp ../.brik_$date ./.brik |
---|
63 | cd .. |
---|
64 | rm -rf gcc/{libio,libstdc++,libstdc++-v3,libf2c,libchill,libobjc} |
---|
65 | rm -rf gcc/{boehm-gc,fastjar,libffi,libjava,zlib} |
---|
66 | rm -rf gcc/gcc/{testsuite,f,objc,cp,java,ch} |
---|
67 | mv gcc gcc-$date |
---|
68 | |
---|
69 | rm -rf files_$date |
---|
70 | rm -rf files_$last_date |
---|
71 | |
---|
72 | # Diff them |
---|
73 | diff -Nrc3p gcc-$last_date gcc-$date > gcc-core-$last_date-$date.diff |
---|
74 | |
---|
75 | # Make the tarball for the core |
---|
76 | tar cf - gcc-$date | gzip --best > gcc-core-$date.tar.gz |
---|
77 | |
---|
78 | # Remove the core gunk and get the whole thing back. |
---|
79 | rm -rf gcc-$last_date |
---|
80 | rm -rf gcc-$date |
---|
81 | #zcat ~ftp/pub/gcc/snapshots/1998-05-31/gcc-$last_date.tar.gz | tar xf - |
---|
82 | cvs -z 9 -Q export -rgcc_ss_$last_date gcc |
---|
83 | mv gcc gcc-$last_date |
---|
84 | cp .brik_$last_date gcc-$last_date/.brik |
---|
85 | cvs -z 9 -Q export -rgcc_ss_$date gcc |
---|
86 | cd gcc |
---|
87 | contrib/gcc_update --touch |
---|
88 | cd .. |
---|
89 | mv gcc gcc-$date |
---|
90 | cp .brik_$date gcc-$date/.brik |
---|
91 | |
---|
92 | # We don't need this anymore. |
---|
93 | rm -rf .brik_$date |
---|
94 | rm -rf .brik_$last_date |
---|
95 | |
---|
96 | # Now make diffs for g77, g77-testsuite chill, java objc, g++, g++-testsuite, |
---|
97 | # testsuite, then the whole bloody thing. |
---|
98 | diff -Nrc3p gcc-$last_date/gcc/f gcc-$date/gcc/f > gcc-g77-$last_date-$date.diff |
---|
99 | diff -Nrc3p gcc-$last_date/libf2c gcc-$date/libf2c >> gcc-g77-$last_date-$date.diff |
---|
100 | |
---|
101 | diff -Nrc3p gcc-$last_date/gcc/testsuite/g77.f-torture gcc-$date/gcc/testsuite/g77.f-torture > gcc-g77-testsuite-$last_date-$date.diff |
---|
102 | |
---|
103 | diff -Nrc3p gcc-$last_date/gcc/objc gcc-$date/gcc/objc > gcc-objc-$last_date-$date.diff |
---|
104 | diff -Nrc3p gcc-$last_date/libobjc gcc-$date/libobjc >> gcc-objc-$last_date-$date.diff |
---|
105 | |
---|
106 | diff -Nrc3p gcc-$last_date/gcc/java gcc-$date/gcc/java > gcc-java-$last_date-$date.diff |
---|
107 | diff -Nrc3p gcc-$last_date/boehm-gc gcc-$date/boehm-gc >> gcc-java-$last_date-$date.diff |
---|
108 | diff -Nrc3p gcc-$last_date/fastjar gcc-$date/fastjar >> gcc-java-$last_date-$date.diff |
---|
109 | diff -Nrc3p gcc-$last_date/libffi gcc-$date/libffi >> gcc-java-$last_date-$date.diff |
---|
110 | diff -Nrc3p gcc-$last_date/libjava gcc-$date/libjava >> gcc-java-$last_date-$date.diff |
---|
111 | diff -Nrc3p gcc-$last_date/zlib gcc-$date/zlib >> gcc-java-$last_date-$date.diff |
---|
112 | |
---|
113 | diff -Nrc3p gcc-$last_date/gcc/ch gcc-$date/gcc/ch > gcc-chill-$last_date-$date.diff |
---|
114 | diff -Nrc3p gcc-$last_date/libchill gcc-$date/libchill >> gcc-chill-$last_date-$date.diff |
---|
115 | |
---|
116 | diff -Nrc3p gcc-$last_date/gcc/cp gcc-$date/gcc/cp > gcc-g++-$last_date-$date.diff |
---|
117 | diff -Nrc3p gcc-$last_date/libio gcc-$date/libio >> gcc-g++-$last_date-$date.diff |
---|
118 | diff -Nrc3p gcc-$last_date/libstdc++ gcc-$date/libstdc++ >> gcc-g++-$last_date-$date.diff |
---|
119 | diff -Nrc3p gcc-$last_date/libstdc++-v3 gcc-$date/libstdc++-v3 >> gcc-g++-$last_date-$date.diff |
---|
120 | |
---|
121 | diff -Nrc3p gcc-$last_date/gcc/testsuite/g++.old-deja gcc-$date/gcc/testsuite/g++.old-deja > gcc-g++-tests-$last_date-$date.diff |
---|
122 | |
---|
123 | diff -Nrc3p gcc-$last_date/gcc/testsuite gcc-$date/gcc/testsuite > gcc-tests-$last_date-$date.diff |
---|
124 | |
---|
125 | diff -Nrc3p gcc-$last_date gcc-$date > gcc-$last_date-$date.diff |
---|
126 | |
---|
127 | |
---|
128 | # Apply the patches to the old snapshot and run another diff to see if anything |
---|
129 | # bad happened. |
---|
130 | cd gcc-$last_date |
---|
131 | patch -p1 -E -s < ../gcc-$last_date-$date.diff |
---|
132 | find . -name \*.orig -print | xargs rm -rf |
---|
133 | rm -rf .brik.orig |
---|
134 | find . -name \*.rej > $STATEDIR/CHECKME |
---|
135 | ~law/bin/brik -C .brik >> $STATEDIR/CHECKME |
---|
136 | cd .. |
---|
137 | diff -Nrc3p gcc-$last_date gcc-$date >> $STATEDIR/CHECKME |
---|
138 | |
---|
139 | # Remove the old snapshot, we're done with it. |
---|
140 | #rm -rf gcc-$last_date |
---|
141 | |
---|
142 | # Make tarballs |
---|
143 | # Touch all the machine generated files so people don't need gperf, bison and friends. |
---|
144 | |
---|
145 | tar cf - gcc-$date/.brik gcc-$date/gcc/f gcc-$date/libf2c | gzip --best > gcc-g77-$date.tar.gz |
---|
146 | tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite/g77.f-torture | gzip --best > gcc-g77-testsuite-$date.tar.gz |
---|
147 | tar cf - gcc-$date/.brik gcc-$date/gcc/objc gcc-$date/libobjc | gzip --best > gcc-objc-$date.tar.gz |
---|
148 | tar cf - gcc-$date/.brik gcc-$date/gcc/java gcc-$date/{boehm-gc,fastjar,libffi,libjava,zlib} | gzip --best > gcc-java-$date.tar.gz |
---|
149 | tar cf - gcc-$date/.brik gcc-$date/gcc/ch gcc-$date/libchill | gzip --best > gcc-chill-$date.tar.gz |
---|
150 | tar cf - gcc-$date/.brik gcc-$date/gcc/cp gcc-$date/{libio,libstdc++,libstdc++-v3} | gzip --best > gcc-g++-$date.tar.gz |
---|
151 | tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite/g++.old-deja | gzip --best > gcc-g++-tests-$date.tar.gz |
---|
152 | tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite | gzip --best > gcc-tests-$date.tar.gz |
---|
153 | tar cf - gcc-$date | gzip --best > gcc-$date.tar.gz |
---|
154 | |
---|
155 | # Compress the diff files. |
---|
156 | gzip --best *.diff |
---|
157 | |
---|
158 | # Copy them to the FTP server XXX |
---|
159 | mkdir ~ftp/pub/gcc/snapshots/$snapdir |
---|
160 | chmod 775 ~ftp/pub/gcc/snapshots/$snapdir |
---|
161 | cp *.gz ~ftp/pub/gcc/snapshots/$snapdir |
---|
162 | foreach tst (*.gz) |
---|
163 | echo $tst `sum $tst` >>~ftp/pub/gcc/snapshots/$snapdir/CHECKSUMS |
---|
164 | end |
---|
165 | |
---|
166 | # Update links on the ftp server |
---|
167 | $SCRIPTDIR/update_links $date |
---|
168 | |
---|
169 | # Get back to the toplevel directory before we update the date. |
---|
170 | cd $STATEDIR |
---|
171 | |
---|
172 | # Note that we made a snapshot today |
---|
173 | mv .snapshot_date .prev_snapshot_date |
---|
174 | echo $date > .snapshot_date |
---|
175 | |
---|
176 | $SCRIPTDIR/update_tags |
---|
177 | |
---|
178 | # Announce it XXX |
---|
179 | mail -s "gcc-ss-$date is now available" gcc@gcc.gnu.org < ~ftp/pub/gcc/snapshots/README |
---|
180 | mail -s "snapshot:CHECKME" law@cygnus.com < $STATEDIR/CHECKME |
---|
181 | rm -rf $TMPDIR/$$ |
---|