#
# Copyright (c) 2001, 2002 Free Software Foundation.
#
-# This file is part of GNU CC.
+# This file is part of GCC.
#
-# GNU CC is free software; you can redistribute it and/or modify
+# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
-# GNU CC is distributed in the hope that it will be useful,
+# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with GNU CC; see the file COPYING. If not, write to
+# along with GCC; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
usage() {
cat <<EOF
-gcc_release [-d destination]
- [-u username]
- [-r release]
- [-t tag]
- [-p previous-tarball]
- [-s] [-f] [-l]
+gcc_release -r release [further options]
+gcc_release -s [further options]
+
+Options:
+
+ -r release Version of the form X.Y or X.Y.Z.
+ -s Create a snapshot, not a real release.
+
+ -d destination Local working directory where we will build the release
+ (default=${HOME}).
+ -f Create a final release (and update ChangeLogs,...).
+ -l Indicate that we are running on gcc.gnu.org.
+ -p previous-tarball Location of a previous tarball (to generate diff files).
+ -t tag Tag to mark the release in CVS.
+ -u username Username for upload operations.
EOF
exit 1
}
-r ${BRANCH} gcc || \
error "Could not check out release sources"
for x in `find ${SOURCE_DIRECTORY} -name ChangeLog`; do
- cat - ${x} > ${x}.new <<EOF
+ # Update this ChangeLog file only if it does not yet contain the
+ # entry we are going to add. (This is a safety net for repeated
+ # runs of this script for the same release.)
+ if ! grep "GCC ${RELEASE} released." ${x} > /dev/null ; then
+ cat - ${x} > ${x}.new <<EOF
${LONG_DATE} Release Manager
- * GCC ${RELEASE} Released.
+ * GCC ${RELEASE} released.
EOF
- mv ${x}.new ${x} || \
- error "Could not update ${x}"
- (changedir `dirname ${x}` && \
- ${CVS} ci -m 'Mark ChangeLog' `basename ${x}`) || \
- error "Could not commit ${x}"
+ mv ${x}.new ${x} || \
+ error "Could not update ${x}"
+ (changedir `dirname ${x}` && \
+ ${CVS} ci -m 'Mark ChangeLog' `basename ${x}`) || \
+ error "Could not commit ${x}"
+ fi
done
- # Update `gcc/version.c'. There are other version files
- # as well, which should have release status updated.
+ # Update `gcc/version.c'.
for x in gcc/version.c; do
y=`basename ${x}`
(changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
${CVS} ci -m 'Update version' ${y}) || \
error "Could not update ${x}"
done
- for x in gcc/f/version.c libf2c/libF77/Version.c \
- libf2c/libI77/Version.c libf2c/libU77/Version.c; do
- y=`basename ${x}`
- (changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
- sed -e 's/experimental\|prerelease/release/g' < ${y} > ${y}.new && \
- mv ${y}.new ${y} && \
- ${CVS} ci -m 'Update version' ${y}) || \
- error "Could not update ${x}"
- done
# Make sure we tag the sources for a final release.
TAG="gcc_`echo ${RELEASE} | tr . _`_release"
# Now, build one for each of the languages.
build_tarfile gcc-ada-${RELEASE} ${ADA_DIRS}
- build_tarfile gcc-chill-${RELEASE} ${CHILL_DIRS}
build_tarfile gcc-g++-${RELEASE} ${CPLUSPLUS_DIRS}
build_tarfile gcc-g77-${RELEASE} ${FORTRAN_DIRS}
build_tarfile gcc-java-${RELEASE} ${JAVA_DIRS}
# The core is everything else.
EXCLUDES=""
- for x in ${ADA_DIRS} ${CHILL_DIRS} ${CPLUSPLUS_DIRS} ${FORTRAN_DIRS} \
+ for x in ${ADA_DIRS} ${CPLUSPLUS_DIRS} ${FORTRAN_DIRS} \
${JAVA_DIRS} ${OBJECTIVEC_DIRS} ${TESTSUITE_DIRS}; do
EXCLUDES="${EXCLUDES} --exclude $x"
done
build_tarfile gcc-core-${RELEASE} ${EXCLUDES} \
`basename ${SOURCE_DIRECTORY}`
+}
- # Build .bz2 files.
+# Build .bz2 files.
+build_bzip2() {
for f in ${FILE_LIST}; do
bzfile=${f%.gz}.bz2
(zcat $f | ${BZIP2} > ${bzfile}) || error "Could not create ${bzfile}"
- FILE_LIST="${FILE_LIST} ${bzfile}"
done
}
old_vers=${old_file%.tar.gz}
old_vers=${old_vers#gcc-}
inform "Building diffs against version $old_vers"
- for f in gcc gcc-g++ gcc-g77 gcc-java gcc-objc gcc-testsuite gcc-core; do
+ for f in gcc gcc-ada gcc-g++ gcc-g77 gcc-java gcc-objc gcc-testsuite gcc-core; do
old_tar=${old_dir}/${f}-${old_vers}.tar.gz
new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.gz
- if [ -e $old_tar ] && [ -e $new_tar ]; then
+ if [ ! -e $old_tar ]; then
+ inform "$old_tar not found; not generating diff file"
+ elif [ ! -e $new_tar ]; then
+ inform "$new_tar not found; not generating diff file"
+ else
build_diff $old_tar gcc-${old_vers} $new_tar gcc-${RELEASE} \
${f}-${old_vers}-${RELEASE}.diff.gz
fi
# Make sure the directory exists on the server.
if [ $LOCAL -eq 0 ]; then
- ${SSH} -l ${GCC_USERNAME} ${GCC_HOSTNAME} mkdir ${FTP_PATH}
+ ${SSH} -l ${GCC_USERNAME} ${GCC_HOSTNAME} \
+ mkdir -p "${FTP_PATH}/diffs"
+ UPLOAD_PATH="${GCC_USERNAME}@${GCC_HOSTNAME}:${FTP_PATH}"
else
- mkdir -p "${FTP_PATH}" \
+ mkdir -p "${FTP_PATH}/diffs" \
|| error "Could not create \`${FTP_PATH}'"
+ UPLOAD_PATH=${FTP_PATH}
fi
+ # Then copy files to their respective (sub)directories.
for x in gcc*.gz gcc*.bz2; do
if [ -e ${x} ]; then
# Make sure the file will be readable on the server.
chmod a+r ${x}
# Copy it.
- ${SCP} ${x} ${FTP_PATH} || \
- error "Could not upload ${x}"
+ case ${x} in
+ *.diff.*)
+ SUBDIR="diffs/";
+ ;;
+ *)
+ SUBDIR="";
+ esac
+ ${SCP} ${x} ${UPLOAD_PATH}/${SUBDIR} \
+ || error "Could not upload ${x}"
fi
done
}
# The directories that should be part of the various language-specific
# tar files. These are all relative to the top of the source tree.
ADA_DIRS="gcc/ada"
-CHILL_DIRS="gcc/ch libchill"
CPLUSPLUS_DIRS="gcc/cp libstdc++-v3"
FORTRAN_DIRS="gcc/f libf2c"
JAVA_DIRS="gcc/java libjava libffi fastjar zlib boehm-gc"
LOCAL=0
# Major operation modes.
+MODE_BZIP2=0
MODE_DIFFS=0
MODE_SOURCES=0
MODE_TARFILES=0
MODE_UPLOAD=0
-# Files generated to upload.
+# .gz files generated to create .bz2 files from.
FILE_LIST=""
# Programs we use.
fi
else
RELEASE=$DATE
- # For now snapshots come from the mainline.
- BRANCH=HEAD
+ # For now snapshots come from the 3.3 branch.
+ BRANCH=gcc-3_3-branch
FTP_PATH="${FTP_PATH}/snapshots/${LONG_DATE}"
TAG=gcc_ss_${DATE}
# Recompute the names of all the language-specific directories,
# relative to the WORKING_DIRECTORY.
ADA_DIRS=`adjust_dirs ${ADA_DIRS}`
-CHILL_DIRS=`adjust_dirs ${CHILL_DIRS}`
CPLUSPLUS_DIRS=`adjust_dirs ${CPLUSPLUS_DIRS}`
FORTRAN_DIRS=`adjust_dirs ${FORTRAN_DIRS}`
JAVA_DIRS=`adjust_dirs ${JAVA_DIRS}`
# Main Program
########################################################################
+# Set the timezone to UTC
+TZ="UTC0"
+export TZ
+
# Handle the major modes.
while [ $# -ne 0 ]; do
case $1 in
+ bzip2) MODE_BZIP2=1;;
diffs) MODE_DIFFS=1;;
sources) MODE_SOURCES=1;;
tarfiles) MODE_TARFILES=1;;
upload) MODE_UPLOAD=1;;
- all) MODE_SOURCES=1; MODE_TARFILES=1; MODE_DIFFS=1; MODE_UPLOAD=1;;
+ all) MODE_SOURCES=1; MODE_TARFILES=1; MODE_DIFFS=1; MODE_BZIP2=1; MODE_UPLOAD=1;;
*) error "Unknown mode $1";;
esac
shift
fi
fi
+# Build bzip2 files
+if [ $MODE_BZIP2 -ne 0 ]; then
+ build_bzip2
+fi
+
# Upload them to the FTP server.
if [ $MODE_UPLOAD -ne 0 ]; then