for x in gcc/version.c; do
y=`basename ${x}`
(changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
- sed -e 's|= \".*\"|= \"'${RELEASE}'\"|g' < ${y} > ${y}.new && \
+ sed -e 's|version_string\[\] = \".*\"|version_string\[\] = \"'${RELEASE}'\"|g' < ${y} > ${y}.new && \
mv ${y}.new ${y} && \
${CVS} ci -m 'Update version' ${y}) || \
error "Could not update ${x}"
inform "Tagging sources as ${TAG}"
${CVS} rtag -r ${CVSBRANCH} -F ${TAG} gcc || \
error "Could not tag sources"
- CVSBRANCH=$TAG
+ EXPORTTAG="-r${TAG}"
+ EXPORTDATE=""
+ else
+ if [ ${CVSBRANCH} != "HEAD" ]; then
+ EXPORTTAG="-r${CVSBRANCH}"
+ else
+ # HEAD is the default branch, no need to specify it.
+ EXPORTTAG=""
+ fi
+ EXPORTDATE="-D`date -u +"%Y-%m-%d %H:%M"` UTC"
fi
# Export the current sources.
- inform "Retrieving release sources"
- ${CVS} \
- export -d "`basename ${SOURCE_DIRECTORY}`" \
- -r ${CVSBRANCH} gcc || \
- error "Could not retrieve release sources"
+ inform "Retrieving sources (cvs export ${EXPORTTAG} ${EXPORTDATE} gcc)"
+
+ if [ -z "${EXPORTTAG}" ]; then
+ ${CVS} export -d "`basename ${SOURCE_DIRECTORY}`" \
+ "${EXPORTDATE}" gcc || \
+ error "Could not retrieve sources"
+ elif [ -z "${EXPORTDATE}" ]; then
+ ${CVS} export -d "`basename ${SOURCE_DIRECTORY}`" \
+ "${EXPORTTAG}" gcc || \
+ error "Could not retrieve sources"
+ else
+ error "Cannot specify -r and -D at the same time"
+ fi
- # Run gcc_update on them to set up the timestamps nicely.
+ # Run gcc_update on them to set up the timestamps nicely, and (re)write
+ # the LAST_UPDATED file containing the CVS tag/date used.
changedir "gcc-${RELEASE}"
contrib/gcc_update --touch
+ echo "Obtained from CVS: ${EXPORTTAG} ${EXPORTDATE}" > LAST_UPDATED
# Obtain some documentation files from the wwwdocs module.
inform "Retrieving HTML documentation"
# on at least one platform.
inform "Building compiler"
OBJECT_DIRECTORY=../objdir
- contrib/gcc_build -d ${SOURCE_DIRECTORY} -o ${OBJECT_DIRECTORY} build || \
+ contrib/gcc_build -d ${SOURCE_DIRECTORY} -o ${OBJECT_DIRECTORY} \
+ -c "--enable-generated-files-in-srcdir" build || \
error "Could not rebuild GCC"
# Regenerate the Fotran NEWS and BUGS files.
TEXT_DATE=`date --date=$DATE +%B\ %d,\ %Y`
cd ~ftp/pub/gcc/snapshots
sed -e "s%@DATE@%$DATE%g" \
- -e "s%@LAST_DATE@%$LAST_DATE%g" \
+ -e "s%@TEXT_DATE@%$TEXT_DATE%g" \
+ -e "s%@LAST_DATE@%$LAST_DATE%g" \
-e "s%@BRANCH@%${BRANCH}%g" \
-e "s%@RELEASE@%${RELEASE}%g" \
- -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-README > $$
+ -e "s%@EXPORT@%${EXPORTTAG} ${EXPORTDATE}%g" \
+ ~/scripts/snapshot-README > $$
mv $$ ${RELEASE}/README
sed -e "s%@DATE@%$DATE%g" \
- -e "s%@LAST_DATE@%$LAST_DATE%g" \
+ -e "s%@TEXT_DATE@%$TEXT_DATE%g" \
+ -e "s%@LAST_DATE@%$LAST_DATE%g" \
-e "s%@BRANCH@%${BRANCH}%g" \
-e "s%@RELEASE@%${RELEASE}%g" \
- -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-index.html > $$
+ -e "s%@EXPORT@%${EXPORTTAG} ${EXPORTDATE}%g" \
+ ~/scripts/snapshot-index.html > $$
mv $$ ${RELEASE}/index.html
touch LATEST-IS-${BRANCH}-${DATE}
# If this is not a final release, set various parameters acordingly.
if [ ${FINAL} -ne 1 ]; then
RELEASE="${RELEASE}-${DATE}"
- FTP_PATH="${FTP_PATH}/snapshots/"
+ FTP_PATH="${FTP_PATH}/prerelease-${RELEASE}/"
else
FTP_PATH="${FTP_PATH}/releases/gcc-${RELEASE}/"
fi