3 # GCC snapshot generation script.
5 # Originally written by Jeff Law <law@redhat.com>. Most minor modifications
6 # by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>.
8 # TODO: Include the FAQ and installation instructions in the snapshot
10 set SCRIPTDIR=/home/law/gcc
11 set STATEDIR=/home/law
14 set path = (/usr/local/bin $path)
16 # Get somewhere useful with a lot of disk space.
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`
24 # Update and uncomment the following lines to run a particular snapshot pair.
26 #set last_date=19990920
28 # We run this on the cvs server itself so we can get at
29 # the cvs files quickly.
30 setenv CVSROOT /cvs/gcc
32 # Get into a temporary directory so as not to be confused by
33 # any existing CVS administration files.
38 # Tag the current sources for the snapshot
39 cvs -z 9 -Q rtag -F gcc_ss_$date gcc
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
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
51 rm -rf gcc/{libio,libstdc++,libstdc++-v3,libf2c,libchill,libobjc}
52 rm -rf gcc/gcc/{testsuite,f,objc,cp,java,ch}
55 # Similarly for today's gcc-core module snapshot
56 cvs -z 9 -Q export -rgcc_ss_$date gcc
58 contrib/gcc_update --touch
59 find . -type f -print | sort > ../files_$date
60 ~law/bin/brik -Gb -f ../files_$date > ../.brik_$date
61 cp ../.brik_$date ./.brik
63 rm -rf gcc/{libio,libstdc++,libstdc++-v3,libf2c,libchill,libobjc}
64 rm -rf gcc/gcc/{testsuite,f,objc,cp,java,ch}
68 rm -rf files_$last_date
71 diff -Nrc3p gcc-$last_date gcc-$date > gcc-core-$last_date-$date.diff
73 # Make the tarball for the core
74 tar cf - gcc-$date | gzip --best > gcc-core-$date.tar.gz
76 # Remove the core gunk and get the whole thing back.
79 #zcat ~ftp/pub/gcc/snapshots/1998-05-31/gcc-$last_date.tar.gz | tar xf -
80 cvs -z 9 -Q export -rgcc_ss_$last_date gcc
82 cp .brik_$last_date gcc-$last_date/.brik
83 cvs -z 9 -Q export -rgcc_ss_$date gcc
85 contrib/gcc_update --touch
88 cp .brik_$date gcc-$date/.brik
90 # We don't need this anymore.
92 rm -rf .brik_$last_date
94 # Now make diffs for g77, g77-testsuite chill, java objc, g++, g++-testsuite,
95 # testsuite, then the whole bloody thing.
96 diff -Nrc3p gcc-$last_date/gcc/f gcc-$date/gcc/f > gcc-g77-$last_date-$date.diff
97 diff -Nrc3p gcc-$last_date/libf2c gcc-$date/libf2c >> gcc-g77-$last_date-$date.diff
99 diff -Nrc3p gcc-$last_date/gcc/testsuite/g77.f-torture gcc-$date/gcc/testsuite/g77.f-torture > gcc-g77-testsuite-$last_date-$date.diff
101 diff -Nrc3p gcc-$last_date/gcc/objc gcc-$date/gcc/objc > gcc-objc-$last_date-$date.diff
102 diff -Nrc3p gcc-$last_date/libobjc gcc-$date/libobjc >> gcc-objc-$last_date-$date.diff
104 diff -Nrc3p gcc-$last_date/gcc/java gcc-$date/gcc/java > gcc-java-$last_date-$date.diff
106 diff -Nrc3p gcc-$last_date/gcc/ch gcc-$date/gcc/ch > gcc-chill-$last_date-$date.diff
107 diff -Nrc3p gcc-$last_date/libchill gcc-$date/libchill >> gcc-chill-$last_date-$date.diff
109 diff -Nrc3p gcc-$last_date/gcc/cp gcc-$date/gcc/cp > gcc-g++-$last_date-$date.diff
110 diff -Nrc3p gcc-$last_date/libio gcc-$date/libio >> gcc-g++-$last_date-$date.diff
111 diff -Nrc3p gcc-$last_date/libstdc++ gcc-$date/libstdc++ >> gcc-g++-$last_date-$date.diff
112 diff -Nrc3p gcc-$last_date/libstdc++-v3 gcc-$date/libstdc++-v3 >> gcc-g++-$last_date-$date.diff
114 diff -Nrc3p gcc-$last_date/gcc/testsuite/g++.old-deja gcc-$date/gcc/testsuite/g++.old-deja > gcc-g++-tests-$last_date-$date.diff
116 diff -Nrc3p gcc-$last_date/gcc/testsuite gcc-$date/gcc/testsuite > gcc-tests-$last_date-$date.diff
118 diff -Nrc3p gcc-$last_date gcc-$date > gcc-$last_date-$date.diff
121 # Apply the patches to the old snapshot and run another diff to see if anything
124 patch -p1 -E -s < ../gcc-$last_date-$date.diff
125 find . -name \*.orig -print | xargs rm -rf
127 find . -name \*.rej > $STATEDIR/CHECKME
128 ~law/bin/brik -C .brik >> $STATEDIR/CHECKME
130 diff -Nrc3p gcc-$last_date gcc-$date >> $STATEDIR/CHECKME
132 # Remove the old snapshot, we're done with it.
133 #rm -rf gcc-$last_date
136 # Touch all the machine generated files so people don't need gperf, bison and friends.
138 tar cf - gcc-$date/.brik gcc-$date/gcc/f gcc-$date/libf2c | gzip --best > gcc-g77-$date.tar.gz
139 tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite/g77.f-torture | gzip --best > gcc-g77-testsuite-$date.tar.gz
140 tar cf - gcc-$date/.brik gcc-$date/gcc/objc gcc-$date/libobjc | gzip --best > gcc-objc-$date.tar.gz
141 tar cf - gcc-$date/.brik gcc-$date/gcc/java | gzip --best > gcc-java-$date.tar.gz
142 tar cf - gcc-$date/.brik gcc-$date/gcc/ch gcc-$date/libchill | gzip --best > gcc-chill-$date.tar.gz
143 tar cf - gcc-$date/.brik gcc-$date/gcc/cp gcc-$date/{libio,libstdc++,libstdc++-v3} | gzip --best > gcc-g++-$date.tar.gz
144 tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite/g++.old-deja | gzip --best > gcc-g++-tests-$date.tar.gz
145 tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite | gzip --best > gcc-tests-$date.tar.gz
146 tar cf - gcc-$date | gzip --best > gcc-$date.tar.gz
148 # Compress the diff files.
151 # Copy them to the FTP server XXX
152 mkdir ~ftp/pub/gcc/snapshots/$snapdir
153 chmod 775 ~ftp/pub/gcc/snapshots/$snapdir
154 cp *.gz ~ftp/pub/gcc/snapshots/$snapdir
156 echo $tst `sum $tst` >>~ftp/pub/gcc/snapshots/$snapdir/CHECKSUMS
159 # Update links on the ftp server
160 $SCRIPTDIR/update_links $date
162 # Get back to the toplevel directory before we update the date.
165 # Note that we made a snapshot today
166 mv .snapshot_date .prev_snapshot_date
167 echo $date > .snapshot_date
169 $SCRIPTDIR/update_tags
172 mail -s "gcc-ss-$date is now available" gcc@gcc.gnu.org < ~ftp/pub/gcc/snapshots/README
173 mail -s "snapshot:CHECKME" law@cygnus.com < $STATEDIR/CHECKME