summaryrefslogtreecommitdiff
path: root/maintainer-scripts
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-06-04 01:02:04 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-06-04 01:02:04 +0100
commitd6f3f2616f18370f0c5b0fd186f9e06f191c778e (patch)
tree32acd09f87324b273a29efca369c8b8e373f1a62 /maintainer-scripts
parentf9d189555573e9df0cfdb6b7cc1fb78b84775134 (diff)
downloadgcc-d6f3f2616f18370f0c5b0fd186f9e06f191c778e.tar.gz
gcc_release (maybe_build_tarfile): New function.
* gcc_release (maybe_build_tarfile): New function. (build_tarfiles): Use maybe_build_tarfile. From-SVN: r82613
Diffstat (limited to 'maintainer-scripts')
-rw-r--r--maintainer-scripts/ChangeLog5
-rwxr-xr-xmaintainer-scripts/gcc_release35
2 files changed, 32 insertions, 8 deletions
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index 7964a6a5760..08459ef6bfb 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-03 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * gcc_release (maybe_build_tarfile): New function.
+ (build_tarfiles): Use maybe_build_tarfile.
+
2004-05-21 Paolo Carlini <pcarlini@suse.de>
* gcc_release (build_sources): Generate the NEWS file in toplevel.
diff --git a/maintainer-scripts/gcc_release b/maintainer-scripts/gcc_release
index dec063b7cc4..8b6a5603006 100755
--- a/maintainer-scripts/gcc_release
+++ b/maintainer-scripts/gcc_release
@@ -256,7 +256,7 @@ EOF
# Buid a single tarfile. The first argument is the name of the name
# of the tarfile to build, without any suffixes. They will be added
# automatically. The rest of the arguments are the files or
-# directories to include.
+# directories to include, and possibly other arguments to tar.
build_tarfile() {
# Get the name of the destination tar file.
@@ -269,6 +269,25 @@ build_tarfile() {
FILE_LIST="${FILE_LIST} ${TARFILE}"
}
+# Build a single tarfile if any of the directories listed exist,
+# but not if none of them do (because that component doesn't exist
+# on this branch).
+maybe_build_tarfile() {
+ dest=$1
+ shift
+ dir_exists=0
+ for maybe_dir in "$@"; do
+ if [ -d "$maybe_dir" ]; then
+ dir_exists=1
+ fi
+ done
+ if [ $dir_exists = 1 ]; then
+ build_tarfile "$dest" "$@"
+ else
+ echo "Not building $dest tarfile"
+ fi
+}
+
# Build the various tar files for the release.
build_tarfiles() {
@@ -286,13 +305,13 @@ build_tarfiles() {
build_tarfile gcc-${RELEASE} `basename ${SOURCE_DIRECTORY}`
# Now, build one for each of the languages.
- build_tarfile gcc-ada-${RELEASE} ${ADA_DIRS}
- build_tarfile gcc-g++-${RELEASE} ${CPLUSPLUS_DIRS}
- build_tarfile gcc-g77-${RELEASE} ${FORTRAN_DIRS}
- build_tarfile gcc-fortran-${RELEASE} ${FORTRAN95_DIRS}
- build_tarfile gcc-java-${RELEASE} ${JAVA_DIRS}
- build_tarfile gcc-objc-${RELEASE} ${OBJECTIVEC_DIRS}
- build_tarfile gcc-testsuite-${RELEASE} ${TESTSUITE_DIRS}
+ maybe_build_tarfile gcc-ada-${RELEASE} ${ADA_DIRS}
+ maybe_build_tarfile gcc-g++-${RELEASE} ${CPLUSPLUS_DIRS}
+ maybe_build_tarfile gcc-g77-${RELEASE} ${FORTRAN_DIRS}
+ maybe_build_tarfile gcc-fortran-${RELEASE} ${FORTRAN95_DIRS}
+ maybe_build_tarfile gcc-java-${RELEASE} ${JAVA_DIRS}
+ maybe_build_tarfile gcc-objc-${RELEASE} ${OBJECTIVEC_DIRS}
+ maybe_build_tarfile gcc-testsuite-${RELEASE} ${TESTSUITE_DIRS}
# The core is everything else.
EXCLUDES=""