gcc/contrib/snapshot

182 lines
6.7 KiB
Tcsh
Executable File

#! /bin/csh
#
# GCC snapshot generation script.
#
# Originally written by Jeff Law <law@redhat.com>. Most minor modifications
# by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>.
# TODO: Include the FAQ and installation instructions in the snapshot
set SCRIPTDIR=/home/law/gcc
set STATEDIR=/home/law
set TMPDIR=/var/tmp
set path = (/usr/local/bin $path)
# Get somewhere useful with a lot of disk space.
cd $TMPDIR
# Get date of current and previous snapshot.
set date=`date +%Y%m%d`
set last_date=`cat $STATEDIR/.snapshot_date`
set snapdir=`date +%Y-%m-%d`
# Update and uncomment the following lines to run a particular snapshot pair.
#set date=971215
#set last_date=19990920
# We run this on the cvs server itself so we can get at
# the cvs files quickly.
setenv CVSROOT /cvs/gcc
# Get into a temporary directory so as not to be confused by
# any existing CVS administration files.
rm -rf $$
mkdir $$
cd $$
# Tag the current sources for the snapshot
cvs -z 9 -Q rtag -F gcc_ss_$date gcc
# Get an exported copy of the last gcc-core module snapshot
# arggh gcc-core doesn't work right now, so check out the whole
# thing and remove bits we don't need.
#zcat ~ftp/pub/gcc/snapshots/1998-05-31/gcc-$last_date.tar.gz | tar xf -
cvs -z 9 -Q export -rgcc_ss_$last_date gcc
cd gcc
find . -type f -print | sort > ../files_$last_date
~law/bin/brik -Gb -f ../files_$last_date > ../.brik_$last_date
cp ../.brik_$last_date ./.brik
cd ..
rm -rf gcc/{libio,libstdc++,libstdc++-v3,libf2c,libchill,libobjc}
rm -rf gcc/{boehm-gc,fastjar,libffi,libjava,zlib}
rm -rf gcc/gcc/{testsuite,f,objc,cp,java,ch}
mv gcc gcc-$last_date
# Similarly for today's gcc-core module snapshot
cvs -z 9 -Q export -rgcc_ss_$date gcc
cd gcc
contrib/gcc_update --touch
find . -type f -print | sort > ../files_$date
~law/bin/brik -Gb -f ../files_$date > ../.brik_$date
cp ../.brik_$date ./.brik
cd ..
rm -rf gcc/{libio,libstdc++,libstdc++-v3,libf2c,libchill,libobjc}
rm -rf gcc/{boehm-gc,fastjar,libffi,libjava,zlib}
rm -rf gcc/gcc/{testsuite,f,objc,cp,java,ch}
mv gcc gcc-$date
rm -rf files_$date
rm -rf files_$last_date
# Diff them
diff -Nrc3p gcc-$last_date gcc-$date > gcc-core-$last_date-$date.diff
# Make the tarball for the core
tar cf - gcc-$date | gzip --best > gcc-core-$date.tar.gz
# Remove the core gunk and get the whole thing back.
rm -rf gcc-$last_date
rm -rf gcc-$date
#zcat ~ftp/pub/gcc/snapshots/1998-05-31/gcc-$last_date.tar.gz | tar xf -
cvs -z 9 -Q export -rgcc_ss_$last_date gcc
mv gcc gcc-$last_date
cp .brik_$last_date gcc-$last_date/.brik
cvs -z 9 -Q export -rgcc_ss_$date gcc
cd gcc
contrib/gcc_update --touch
cd ..
mv gcc gcc-$date
cp .brik_$date gcc-$date/.brik
# We don't need this anymore.
rm -rf .brik_$date
rm -rf .brik_$last_date
# Now make diffs for g77, g77-testsuite chill, java objc, g++, g++-testsuite,
# testsuite, then the whole bloody thing.
diff -Nrc3p gcc-$last_date/gcc/f gcc-$date/gcc/f > gcc-g77-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/libf2c gcc-$date/libf2c >> gcc-g77-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/gcc/testsuite/g77.f-torture gcc-$date/gcc/testsuite/g77.f-torture > gcc-g77-testsuite-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/gcc/objc gcc-$date/gcc/objc > gcc-objc-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/libobjc gcc-$date/libobjc >> gcc-objc-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/gcc/java gcc-$date/gcc/java > gcc-java-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/boehm-gc gcc-$date/boehm-gc >> gcc-java-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/fastjar gcc-$date/fastjar >> gcc-java-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/libffi gcc-$date/libffi >> gcc-java-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/libjava gcc-$date/libjava >> gcc-java-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/zlib gcc-$date/zlib >> gcc-java-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/gcc/ch gcc-$date/gcc/ch > gcc-chill-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/libchill gcc-$date/libchill >> gcc-chill-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/gcc/cp gcc-$date/gcc/cp > gcc-g++-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/libio gcc-$date/libio >> gcc-g++-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/libstdc++ gcc-$date/libstdc++ >> gcc-g++-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/libstdc++-v3 gcc-$date/libstdc++-v3 >> gcc-g++-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/gcc/testsuite/g++.old-deja gcc-$date/gcc/testsuite/g++.old-deja > gcc-g++-tests-$last_date-$date.diff
diff -Nrc3p gcc-$last_date/gcc/testsuite gcc-$date/gcc/testsuite > gcc-tests-$last_date-$date.diff
diff -Nrc3p gcc-$last_date gcc-$date > gcc-$last_date-$date.diff
# Apply the patches to the old snapshot and run another diff to see if anything
# bad happened.
cd gcc-$last_date
patch -p1 -E -s < ../gcc-$last_date-$date.diff
find . -name \*.orig -print | xargs rm -rf
rm -rf .brik.orig
find . -name \*.rej > $STATEDIR/CHECKME
~law/bin/brik -C .brik >> $STATEDIR/CHECKME
cd ..
diff -Nrc3p gcc-$last_date gcc-$date >> $STATEDIR/CHECKME
# Remove the old snapshot, we're done with it.
#rm -rf gcc-$last_date
# Make tarballs
# Touch all the machine generated files so people don't need gperf, bison and friends.
tar cf - gcc-$date/.brik gcc-$date/gcc/f gcc-$date/libf2c | gzip --best > gcc-g77-$date.tar.gz
tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite/g77.f-torture | gzip --best > gcc-g77-testsuite-$date.tar.gz
tar cf - gcc-$date/.brik gcc-$date/gcc/objc gcc-$date/libobjc | gzip --best > gcc-objc-$date.tar.gz
tar cf - gcc-$date/.brik gcc-$date/gcc/java gcc-$date/{boehm-gc,fastjar,libffi,libjava,zlib} | gzip --best > gcc-java-$date.tar.gz
tar cf - gcc-$date/.brik gcc-$date/gcc/ch gcc-$date/libchill | gzip --best > gcc-chill-$date.tar.gz
tar cf - gcc-$date/.brik gcc-$date/gcc/cp gcc-$date/{libio,libstdc++,libstdc++-v3} | gzip --best > gcc-g++-$date.tar.gz
tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite/g++.old-deja | gzip --best > gcc-g++-tests-$date.tar.gz
tar cf - gcc-$date/.brik gcc-$date/gcc/testsuite | gzip --best > gcc-tests-$date.tar.gz
tar cf - gcc-$date | gzip --best > gcc-$date.tar.gz
# Compress the diff files.
gzip --best *.diff
# Copy them to the FTP server XXX
mkdir ~ftp/pub/gcc/snapshots/$snapdir
chmod 775 ~ftp/pub/gcc/snapshots/$snapdir
cp *.gz ~ftp/pub/gcc/snapshots/$snapdir
foreach tst (*.gz)
echo $tst `sum $tst` >>~ftp/pub/gcc/snapshots/$snapdir/CHECKSUMS
end
# Update links on the ftp server
$SCRIPTDIR/update_links $date
# Get back to the toplevel directory before we update the date.
cd $STATEDIR
# Note that we made a snapshot today
mv .snapshot_date .prev_snapshot_date
echo $date > .snapshot_date
$SCRIPTDIR/update_tags
# Announce it XXX
mail -s "gcc-ss-$date is now available" gcc@gcc.gnu.org < ~ftp/pub/gcc/snapshots/README
mail -s "snapshot:CHECKME" law@cygnus.com < $STATEDIR/CHECKME
rm -rf $TMPDIR/$$