3 ########################################################################
6 # Author: Jeffrey Law, Bernd Schmidt, Mark Mitchell
10 # Script to create a GCC release.
12 # Copyright (c) 2001-2020 Free Software Foundation.
14 # This file is part of GCC.
16 # GCC is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 3, or (at your option)
21 # GCC is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with GCC; see the file COPYING3. If not see
28 # <http://www.gnu.org/licenses/>.
30 ########################################################################
32 ########################################################################
34 ########################################################################
36 # Here is an example usage of this script, to create a GCC 3.0.2
39 # gcc_release -r 3.0.2
41 # This script will automatically use the head of the release branch
42 # to generate the release.
44 ########################################################################
46 ########################################################################
48 # Issue the error message given by $@ and exit with a non-zero
52 echo "gcc_release: error: $@"
56 # Issue the informational message given by $@.
59 echo "gcc_release: $@"
62 # Issue a usage message explaining how to use this script.
66 gcc_release -r release [-f] [further options]
67 gcc_release -s name:gitbranch [further options]
71 -r release Version of the form X.Y or X.Y.Z.
72 -s name:gitbranch Create a snapshot, not a real release.
74 -d destination Local working directory where we will build the release
76 -f Create a final release (and update ChangeLogs,...).
77 -l Indicate that we are running on gcc.gnu.org.
78 -p previous-tarball Location of a previous tarball (to generate diff files).
79 -t tag Tag to mark the release in git.
80 -u username Username for upload operations.
81 -b local-git-repo Local git repository to speed up cloning.
86 # Change to the directory given by $1.
90 error
"Could not change directory to $1"
93 # Build the source tree that will be the basis for the release
94 # in ${WORKING_DIRECTORY}/gcc-${RELEASE}.
97 # If the WORKING_DIRECTORY already exists, do not risk destroying it.
98 if [ -r ${WORKING_DIRECTORY} ]; then
99 error
"\`${WORKING_DIRECTORY}' already exists"
101 # Create the WORKING_DIRECTORY.
102 mkdir
"${WORKING_DIRECTORY}" \
103 || error
"Could not create \`${WORKING_DIRECTORY}'"
104 changedir
"${WORKING_DIRECTORY}"
106 # Check out the sources.
107 if [ -n "${GIT_REFERENCE}" ]; then
108 ${GIT} clone
-q --dissociate --reference "${GIT_REFERENCE}" \
109 -b "${GITBRANCH}" "${GITROOT}" "`basename ${SOURCE_DIRECTORY}`" || \
110 error
"Could not check out release sources"
112 ${GIT} clone -q -b "${GITBRANCH}" "${GITROOT}" "`basename ${SOURCE_DIRECTORY}`" || \
113 error "Could not check out release sources"
116 # If this is a final release, make sure that the ChangeLogs
117 # and version strings are updated.
118 if [ ${FINAL} -ne 0 ]; then
119 inform "Updating ChangeLogs and version files"
121 grep -q "gcc-${RELEASE_MAJOR}/index.html gcc-${RELEASE_MAJOR}/changes.html" \
122 ${SOURCE_DIRECTORY}/contrib/gennews ||\
123 error "New release not listed in contrib/gennews"
125 ${SOURCE_DIRECTORY}/contrib/gennews > NEWS ||\
126 error "Could not regenerate NEWS files"
128 grep -q "no releases of GCC ${RELEASE_MAJOR} have yet been made" NEWS &&\
129 error "gcc-${RELEASE_MAJOR}/index.html has not been updated yet"
131 grep -q "GCC ${RELEASE_MAJOR} has not been released yet" NEWS &&\
132 error "gcc-${RELEASE_MAJOR}/changes.html has not been updated yet"
134 thisindex="http:\/\/gcc.gnu.org\/gcc-${RELEASE_MAJOR}\/index.html"
135 thischanges="http:\/\/gcc.gnu.org\/gcc-${RELEASE_MAJOR}\/changes.html"
136 previndex="http:\/\/gcc.gnu.org\/gcc-`expr ${RELEASE_MAJOR} - 1`\/index.html"
137 sed -n -e "/^${thisindex}/,/^${thischanges}/p" NEWS |\
138 sed -n -e "/Release History/,/References and Acknowledgments/p" |\
139 grep -q "^[[:blank:]]*GCC ${RELEASE_MAJOR}.${RELEASE_MINOR}" ||\
140 error "GCC ${RELEASE_MAJOR}.${RELEASE_MINOR} not mentioned "\
141 "in gcc-${RELEASE_MAJOR}/index.html"
143 sed -n -e "/^${thischanges}/,/^${previndex}/p" NEWS |\
144 grep -q "^[[:blank:]]*GCC ${RELEASE_MAJOR}.${RELEASE_MINOR}" ||\
145 error "GCC ${RELEASE_MAJOR}.${RELEASE_MINOR} not mentioned "\
146 "in gcc-${RELEASE_MAJOR}/changes.html"
151 for x in `changedir
${SOURCE_DIRECTORY} && \
152 find .
-name ChangeLog
`; do
153 # Update this ChangeLog file only if it does not yet contain the
154 # entry we are going to add. (This is a safety net for repeated
155 # runs of this script for the same release.)
156 if ! grep "GCC ${RELEASE} released." ${SOURCE_DIRECTORY}/${x} > /dev/null ; then
157 cat - ${SOURCE_DIRECTORY}/${x} > ${SOURCE_DIRECTORY}/${x}.new <<EOF
158 ${LONG_DATE} Release Manager
160 * GCC ${RELEASE} released.
163 mv ${SOURCE_DIRECTORY}/${x}.new ${SOURCE_DIRECTORY}/${x} \
164 || error "Could not update ${x}"
165 commit_files="${commit_files} ${x}"
169 # Update gcc/DEV-PHASE.
171 if [ `cat ${SOURCE_DIRECTORY}/gcc
/BASE-VER
` != ${RELEASE} ]; then
172 [ ${RELEASE_MAJOR} -lt 5 ] && \
173 error "Release number ${RELEASE} does not match BASE-VER"
174 if [ `cat ${SOURCE_DIRECTORY}/gcc
/BASE-VER
` \
175 = ${RELEASE_MAJOR}.`expr ${RELEASE_MINOR} - 1`.1 \
176 -a x${RELEASE_REVISION} = x0 ]; then
177 (changedir ${SOURCE_DIRECTORY}/gcc && \
178 echo ${RELEASE} > BASE-VER) || \
179 error "Could not update BASE-VER"
180 commit_files="${commit_files} gcc/BASE-VER"
182 error "Release number ${RELEASE} does not immediately follow BASE-VER"
185 (changedir ${SOURCE_DIRECTORY}/gcc && \
187 error "Could not update DEV-PHASE"
188 commit_files="${commit_files} gcc/DEV-PHASE"
190 (changedir ${SOURCE_DIRECTORY} && \
191 ${GIT} commit -q -m 'Update ChangeLog and version files for release' ${commit_files} && \
193 error "Could not commit ChangeLog and version file updates"
195 # Make sure we tag the sources for a final release.
196 TAG="releases/gcc-${RELEASE}"
200 if [ -n "${TAG}" ]; then
201 inform "Tagging sources as ${TAG}"
202 # We don't want to overwrite an existing tag. So, if the tag
203 # already exists, issue an error message; the release manager can
204 # manually remove the tag if appropriate.
205 if (changedir ${SOURCE_DIRECTORY} && \
206 ${GIT} rev-parse "refs/tags/${TAG}" > /dev/null 2>&1); then
207 error "Tag ${TAG} already exists"
209 (changedir ${SOURCE_DIRECTORY} && \
210 ${GIT} tag -s -m "GCC ${RELEASE} release" "${TAG}" && \
211 ${GIT} push origin tag "${TAG}") || \
212 error "Could not tag sources"
216 GITREV=`cd ${SOURCE_DIRECTORY} && ${GIT} rev-parse HEAD
`
217 inform "Sources are commit ${GITREV}"
219 # Make sure there are no uncommitted changes in the sources.
220 status=${WORKING_DIRECTORY}/gitstatus.$$
221 (changedir ${SOURCE_DIRECTORY} && \
222 ${GIT} status --porcelain --ignored > "$status") || \
223 error "Could not get source directory status"
224 if [ -s "$status" ]; then
226 error "Source directory has unexpected changes"
230 # Remove .git from the sources.
231 rm -rf "${SOURCE_DIRECTORY}/.git" || \
232 error "Could not remove .git from sources"
234 # Run gcc_update on them to set up the timestamps nicely, and (re)write
235 # the LAST_UPDATED file containing the git tag/revision used.
236 changedir "gcc-${RELEASE}"
237 contrib/gcc_update --touch
238 echo "Obtained from git: ${GITBRANCH} revision ${GITREV}" > LAST_UPDATED
240 # For a prerelease or real release, we need to generate additional
241 # files not present in git.
242 changedir "${SOURCE_DIRECTORY}"
243 if [ $SNAPSHOT -ne 1 ]; then
244 # Generate the documentation.
245 inform "Building install docs"
246 SOURCEDIR=${SOURCE_DIRECTORY}/gcc/doc
247 DESTDIR=${SOURCE_DIRECTORY}/INSTALL
250 ${SOURCE_DIRECTORY}/gcc/doc/install.texi2html
252 # Regenerate the NEWS file.
253 contrib/gennews > NEWS || \
254 error "Could not regenerate NEWS files"
256 # Now, we must build the compiler in order to create any generated
257 # files that are supposed to go in the source directory. This is
258 # also a good sanity check to make sure that the release builds
259 # on at least one platform.
260 inform "Building compiler"
261 OBJECT_DIRECTORY=../objdir
263 if type -p getconf 2>/dev/null; then
264 num_cpus=`getconf _NPROCESSORS_ONLN
2>/dev
/null
`
266 '' | 0* | *[!0-9]*) num_cpus=1;;
269 contrib/gcc_build -d ${SOURCE_DIRECTORY} -o ${OBJECT_DIRECTORY} \
270 -c "--enable-generated-files-in-srcdir --disable-multilib" \
271 -m "-j$num_cpus" build || \
272 error "Could not rebuild GCC"
275 # Move message catalogs to source directory.
276 mv ../objdir/gcc/po/*.gmo gcc/po/
277 [ -f libcpp/po/cpplib.pot ] && mv ../objdir/libcpp/po/*.gmo libcpp/po/
279 # Create a "MD5SUMS" file to use for checking the validity of the release.
281 "# This file contains the MD5 checksums of the files in the
282 # gcc-"${RELEASE}".tar.xz tarball.
284 # Besides verifying that all files in the tarball were correctly expanded,
285 # it also can be used to determine if any files have changed since the
286 # tarball was expanded or to verify that a patchfile was correctly applied.
289 # md5sum -c MD5SUMS | grep -v \"OK$\"
293 sed -e 's:^\./::' -e '/MD5SUMS/d' |
295 xargs md5sum >>MD5SUMS
298 # Build a single tarfile. The first argument is the name of the tarfile
299 # to build, without any suffixes. They will be added automatically. The
300 # rest of the arguments are files or directories to include, and possibly
301 # other arguments to tar.
304 # Get the name of the destination tar file.
308 # Build the tar file itself.
309 (${TAR} cf - "$@" | ${XZ} > ${TARFILE}) || \
310 error "Could not build tarfile"
311 FILE_LIST="${FILE_LIST} ${TARFILE}"
314 # Build the various tar files for the release.
317 inform "Building tarfiles"
319 changedir "${WORKING_DIRECTORY}"
321 # The GNU Coding Standards specify that all files should
323 chmod -R a+r ${SOURCE_DIRECTORY}
324 # And that all directories have mode 755.
325 find ${SOURCE_DIRECTORY} -type d -exec chmod 755 {} \;
327 # Build one huge tarfile for the entire distribution.
328 build_tarfile gcc-${RELEASE} `basename ${SOURCE_DIRECTORY}`
333 for f in ${FILE_LIST}; do
335 (${XZ} -d -c $f | ${GZIP} > ${target}) || error "Could not create ${target}"
339 # Build diffs against an old release.
344 *.tar.xz) old_vers=${old_file%.tar.xz};;
345 *) old_vers=${old_file%.tar.bz2};;
347 old_vers=${old_vers#gcc-}
348 inform "Building diffs against version $old_vers"
350 if [ -e ${old_dir}/${f}-${old_vers}.tar.xz ]; then
351 old_tar=${old_dir}/${f}-${old_vers}.tar.xz
353 old_tar=${old_dir}/${f}-${old_vers}.tar.bz2
355 new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.xz
356 if [ ! -e $old_tar ]; then
357 inform "$old_tar not found; not generating diff file"
358 elif [ ! -e $new_tar ]; then
359 inform "$new_tar not found; not generating diff file"
361 build_diff $old_tar gcc-${old_vers} $new_tar gcc-${RELEASE} \
362 ${f}-${old_vers}-${RELEASE}.diff.xz
367 # Build an individual diff.
369 changedir "${WORKING_DIRECTORY}"
371 mkdir $tmpdir || error "Could not create directory $tmpdir"
375 (${BZIP2} -d -c $1 | ${TAR} xf - ) || error "Could not unpack $1 for diffs"
378 (${XZ} -d -c $1 | ${TAR} xf - ) || error "Could not unpack $1 for diffs"
381 (${XZ} -d -c $3 | ${TAR} xf - ) || error "Could not unpack $3 for diffs"
382 ${DIFF} $2 $4 > ../${5%.xz}
383 if [ $? -eq 2 ]; then
384 error "Trouble making diffs from $1 to $3"
386 ${XZ} ../${5%.xz} || error "Could not generate ../$5"
389 FILE_LIST="${FILE_LIST} $5"
392 # Upload the files to the FTP server.
394 inform "Uploading files"
396 changedir "${WORKING_DIRECTORY}"
398 # Make sure the directory exists on the server.
399 if [ $LOCAL -eq 0 ]; then
400 ${SSH} -l ${GCC_USERNAME} ${GCC_HOSTNAME} \
401 mkdir -m 755 -p "${FTP_PATH}/diffs"
402 UPLOAD_PATH="${GCC_USERNAME}@${GCC_HOSTNAME}:${FTP_PATH}"
404 mkdir -p "${FTP_PATH}/diffs" \
405 || error "Could not create \`${FTP_PATH}'"
406 UPLOAD_PATH=${FTP_PATH}
409 # Then copy files to their respective (sub)directories.
410 for x in gcc*.gz gcc*.xz; do
412 # Make sure the file will be readable on the server.
422 ${SCP} ${x} ${UPLOAD_PATH}/${SUBDIR} \
423 || error "Could not upload ${x}"
428 # Print description if snapshot exists.
430 if [ -e ${RELEASE}/$1 ]; then
431 hash=`openssl sha256 ${RELEASE}/$1 | sed -e 's
#(.*)##' -e 's# *= *#=#'`
432 hash2
=`openssl sha1 ${RELEASE}/$1 | sed -e 's#(.*)##' -e 's# *= *#=#'`
434 printf " %-37s%s\n\n %s\n %s\n\n" "$1" "$2" "$hash" "$hash2" \
435 >> ${SNAPSHOT_README}
437 echo " <tr><td><a href=\"$1\">$1</a></td>" >> ${SNAPSHOT_INDEX}
438 echo " <td>$2</td></tr>" >> ${SNAPSHOT_INDEX}
442 # Announce a snapshot, both on the web and via mail.
443 announce_snapshot
() {
444 inform
"Updating links and READMEs on the FTP server"
446 TEXT_DATE
=`date --date=$DATE +%B\ %d,\ %Y`
447 SNAPSHOT_README
=${RELEASE}/README
448 SNAPSHOT_INDEX
=${RELEASE}/index.html
450 changedir
"${SNAPSHOTS_DIR}"
452 "Snapshot gcc-"${RELEASE}" is now available on
453 https://gcc.gnu.org/pub/gcc/snapshots/"${RELEASE}"/
454 and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.
456 This snapshot has been generated from the GCC "${BRANCH}" git branch
457 with the following options: "git
://gcc.gnu.org
/git
/gcc.git branch
${GITBRANCH} revision
${GITREV}"
460 " > ${SNAPSHOT_README}
466 <title>GCC "${RELEASE}" Snapshot</title>
470 <h1>GCC "${RELEASE}" Snapshot</h1>
472 <p>The <a href =\"http://gcc.gnu.org/\">GCC Project</a> makes
473 periodic snapshots of the GCC source tree available to the public
474 for testing purposes.</p>
476 <p>If you are planning to download and use one of our snapshots, then
477 we highly recommend you join the GCC developers list. Details for
478 how to sign up can be found on the GCC project home page.</p>
480 <p>This snapshot has been generated from the GCC "${BRANCH}" git branch
481 with the following options: <code>"git
://gcc.gnu.org
/git
/gcc.git branch
${GITBRANCH} revision
${GITREV}"</code></p>
483 <table>" > ${SNAPSHOT_INDEX}
485 snapshot_print gcc-
${RELEASE}.
tar.xz
"Complete GCC"
488 "Diffs from "${BRANCH}"-"${LAST_DATE}" are available in the diffs/ subdirectory.
490 When a particular snapshot is ready for public consumption the LATEST-"${BRANCH}"
491 link is updated and a message is sent to the gcc list. Please do not use
492 a snapshot before it has been announced that way." >> ${SNAPSHOT_README}
496 <p>Diffs from "${BRANCH}"-"${LAST_DATE}" are available in the
497 <a href=\"diffs/\">diffs/ subdirectory</a>.</p>
499 <p>When a particular snapshot is ready for public consumption the LATEST-"${BRANCH}"
500 link is updated and a message is sent to the gcc list. Please do not use
501 a snapshot before it has been announced that way.</p>
506 <a href=\"mailto:gcc@gcc.gnu.org\">gcc@gcc.gnu.org</a>
508 Last modified "${TEXT_DATE}"
512 </html>" >> ${SNAPSHOT_INDEX}
514 rm -f LATEST-
${BRANCH}
515 ln -s ${RELEASE} LATEST-
${BRANCH}
517 inform
"Sending mail"
519 export QMAILHOST
=gcc.gnu.org
520 mail -s "gcc-${RELEASE} is now available" gcc@gcc.gnu.org
< ${SNAPSHOT_README}
523 ########################################################################
525 ########################################################################
531 DATE
=`date "+%Y%m%d"`
532 LONG_DATE
=`date "+%Y-%m-%d"`
535 # The server containing the GCC repository.
536 GIT_SERVER
="gcc.gnu.org"
537 # The path to the repository on that server.
538 GIT_REPOSITORY
="/git/gcc.git"
539 # The username to use when connecting to the server.
540 GIT_USERNAME
="${USER}"
542 # The machine to which files will be uploaded.
543 GCC_HOSTNAME
="gcc.gnu.org"
544 # The name of the account on the machine to which files are uploaded.
545 GCC_USERNAME
="gccadmin"
546 # The directory in which the files will be placed (do not use ~user syntax).
547 FTP_PATH
=/var
/ftp
/pub
/gcc
548 # The directory in which snapshots will be placed.
549 SNAPSHOTS_DIR
=${FTP_PATH}/snapshots
551 # The major number for the release. For release `3.0.2' this would be
554 # The minor number for the release. For release `3.0.2' this would be
557 # The revision number for the release. For release `3.0.2' this would
560 # The complete name of the release.
563 # The name of the branch from which the release should be made, in a
564 # user-friendly form.
567 # The name of the branch from which the release should be made, as used
568 # for our version control system.
571 # The tag to apply to the sources used for the release.
574 # The old tarballs from which to generate diffs.
577 # Local gcc git checkout to speed up git cloning.
580 # The directory that will be used to construct the release. The
581 # release itself will be placed in a subdirectory of this directory.
585 # The directory that will contain the GCC sources.
588 # Non-zero if this is the final release, rather than a prerelease.
591 # Non-zero if we are building a snapshot, and don't build gcc or
592 # include generated files.
595 # Non-zero if we are running locally on gcc.gnu.org, and use local CVS
596 # and copy directly to the FTP directory.
599 # Major operation modes.
606 # List of archive files generated; used to create .gz files from .xz.
611 BZIP2
="${BZIP2:-bzip2}"
612 XZ
="${XZ:-xz --best}"
613 CVS
="${CVS:-cvs -f -Q -z9}"
614 DIFF
="${DIFF:-diff -Nrcpad}"
616 GZIP
="${GZIP:-gzip --best}"
621 ########################################################################
622 # Command Line Processing
623 ########################################################################
626 while getopts "d:fr:u:t:p:s:lb:" ARG
; do
628 d
) DESTINATION
="${OPTARG}";;
629 r
) RELEASE
="${OPTARG}";;
631 u
) GIT_USERNAME
="${OPTARG}";;
635 GITBRANCH
=${OPTARG#*:}
639 PATH
=~
:/usr
/local
/bin
:$PATH;;
640 p
) OLD_TARS
="${OLD_TARS} ${OPTARG}"
641 if [ ! -f ${OPTARG} ]; then
642 error
"-p argument must name a tarball"
644 b
) GIT_REFERENCE
="${OPTARG}";;
648 shift `expr ${OPTIND} - 1`
650 # Handle the major modes.
651 while [ $# -ne 0 ]; do
653 diffs
) MODE_DIFFS
=1;;
655 sources
) MODE_SOURCES
=1;;
656 tarfiles
) MODE_TARFILES
=1;;
657 upload
) MODE_UPLOAD
=1;;
658 all
) MODE_SOURCES
=1; MODE_TARFILES
=1; MODE_DIFFS
=1; MODE_UPLOAD
=1;
659 if [ $SNAPSHOT -ne 1 ]; then
660 # Only for releases and pre-releases.
664 *) error
"Unknown mode $1";;
669 # Perform consistency checking.
670 if [ ${LOCAL} -eq 0 ] && [ -z ${GIT_USERNAME} ]; then
671 error
"No username specified"
674 if [ ! -d ${DESTINATION} ]; then
675 error
"\`${DESTINATION}' is not a directory"
678 if [ $SNAPSHOT -eq 0 ]; then
679 if [ -z ${RELEASE} ]; then
680 error
"No release number specified"
683 # Compute the major and minor release numbers.
684 RELEASE_MAJOR
=`echo $RELEASE | awk --assign FS=. '{ print $1; }'`
685 RELEASE_MINOR
=`echo $RELEASE | awk --assign FS=. '{ print $2; }'`
686 RELEASE_REVISION
=`echo $RELEASE | awk --assign FS=. '{ print $3; }'`
688 if [ -z "${RELEASE_MAJOR}" ] ||
[ -z "${RELEASE_MINOR}" ]; then
689 error
"Release number \`${RELEASE}' is invalid"
692 # Compute the full name of the release.
693 if [ -z "${RELEASE_REVISION}" ]; then
694 RELEASE
="${RELEASE_MAJOR}.${RELEASE_MINOR}"
696 RELEASE
="${RELEASE_MAJOR}.${RELEASE_MINOR}.${RELEASE_REVISION}"
699 # Compute the name of the branch, which is based solely on the major
701 GITBRANCH
="releases/gcc-${RELEASE_MAJOR}"
703 # If this is not a final release, set various parameters accordingly.
704 if [ ${FINAL} -ne 1 ]; then
705 RELEASE
="${RELEASE}-RC-${DATE}"
706 FTP_PATH
="${SNAPSHOTS_DIR}/${RELEASE}"
708 FTP_PATH
="${FTP_PATH}/releases/gcc-${RELEASE}/"
711 RELEASE
=${BRANCH}-${DATE}
712 FTP_PATH
="${FTP_PATH}/snapshots/${RELEASE}"
714 # If diffs are requested when building locally on gcc.gnu.org, we (usually)
715 # know what the last snapshot date was and take the corresponding tarballs,
716 # unless the user specified tarballs explicitly.
717 if [ $MODE_DIFFS -ne 0 ] && [ $LOCAL -ne 0 ] && [ -z "${OLD_TARS}" ]; then
718 LAST_DATE
=`cat ~/.snapshot_date-${BRANCH}`
719 OLD_TARS
=${SNAPSHOTS_DIR}/${BRANCH}-${LAST_DATE}/gcc-${BRANCH}-${LAST_DATE}.
tar.bz2
720 if [ ! -e $OLD_TARS ]; then
721 OLD_TARS
=${SNAPSHOTS_DIR}/${BRANCH}-${LAST_DATE}/gcc-${BRANCH}-${LAST_DATE}.
tar.xz
726 # Compute the name of the WORKING_DIRECTORY and the SOURCE_DIRECTORY.
727 WORKING_DIRECTORY
="${DESTINATION}/gcc-${RELEASE}"
728 SOURCE_DIRECTORY
="${WORKING_DIRECTORY}/gcc-${RELEASE}"
731 if [ $LOCAL -eq 0 ]; then
732 GITROOT
="git+ssh://${GIT_USERNAME}@${GIT_SERVER}${GIT_REPOSITORY}"
734 GITROOT
="/git/gcc.git"
738 ########################################################################
740 ########################################################################
742 # Set the timezone to UTC
746 # Build the source directory.
748 if [ $MODE_SOURCES -ne 0 ]; then
752 # Build the tar files.
754 if [ $MODE_TARFILES -ne 0 ]; then
760 if [ $MODE_DIFFS -ne 0 ]; then
761 # Possibly build diffs.
762 if [ -n "$OLD_TARS" ]; then
763 for old_tar
in $OLD_TARS; do
770 if [ $MODE_GZIP -ne 0 ]; then
774 # Upload them to the FTP server.
775 if [ $MODE_UPLOAD -ne 0 ]; then
778 # For snapshots, make some further updates.
779 if [ $SNAPSHOT -ne 0 ] && [ $LOCAL -ne 0 ]; then
782 # Update snapshot date file.
784 echo $DATE > .snapshot_date-
${BRANCH}
786 # Remove working directory
787 rm -rf ${WORKING_DIRECTORY}