PATCH: maintainer-scripts/gcc_release
Gerald Pfeifer
pfeifer@dbai.tuwien.ac.at
Tue Jun 17 09:17:00 GMT 2003
This are the changes to gcc_release that successfully rolled yesterdays
snapshot (finally, after a bit of repeated tweaking).
Some general fixes and (documentation) improvements I have committed
already before, so this is mostly raw meat of switching from .gz to .bz2
as default format, with only minor other improvements.
Committed and installed in the gccadmin account.
Gerald
2003-06-17 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* gcc_release (build_tarfile): Build .bz2 files instead of .gz files.
(build_bz2): Rename to build_gzip and create .gz files from .bz2
files instead of the other way around.
(build_gzip): New function.
(build_diffs): Build .bz2 files instead of .gz files.
(build_diff): Use .bz2 files instead of .gz files.
Make an error message independent of the compression format.
(MODE_BZIP2): Rename to MODE_GZIP. Related changes to the invocation
of this script.
(MODE_GZIP): New variable.
(OLD_TARS): Use .bz2 archive of the previous snapshot.
Index: gcc_release
===================================================================
RCS file: /cvs/gcc/gcc/maintainer-scripts/gcc_release,v
retrieving revision 1.27
diff -u -3 -p -r1.27 gcc_release
--- gcc_release 10 Jun 2003 08:49:59 -0000 1.27
+++ gcc_release 17 Jun 2003 08:57:01 -0000
@@ -245,11 +245,11 @@ EOF
build_tarfile() {
# Get the name of the destination tar file.
- TARFILE="$1.tar.gz"
+ TARFILE="$1.tar.bz2"
shift
# Build the tar file itself.
- (${TAR} cf - "$@" | ${GZIP} > ${TARFILE}) || \
+ (${TAR} cf - "$@" | ${BZIP2} > ${TARFILE}) || \
error "Could not build tarfile"
FILE_LIST="${FILE_LIST} ${TARFILE}"
}
@@ -288,11 +288,11 @@ build_tarfiles() {
`basename ${SOURCE_DIRECTORY}`
}
-# Build .bz2 files.
-build_bzip2() {
+# Build .gz files.
+build_gzip() {
for f in ${FILE_LIST}; do
- bzfile=${f%.gz}.bz2
- (zcat $f | ${BZIP2} > ${bzfile}) || error "Could not create ${bzfile}"
+ target=${f%.bz2}.gz
+ (${BZIP2} -d -c $f | ${GZIP} > ${target}) || error "Could not create ${target}"
done
}
@@ -300,19 +300,19 @@ build_bzip2() {
build_diffs() {
old_dir=${1%/*}
old_file=${1##*/}
- old_vers=${old_file%.tar.gz}
+ old_vers=${old_file%.tar.bz2}
old_vers=${old_vers#gcc-}
inform "Building diffs against version $old_vers"
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
+ old_tar=${old_dir}/${f}-${old_vers}.tar.bz2
+ new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.bz2
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
+ ${f}-${old_vers}-${RELEASE}.diff.bz2
fi
done
}
@@ -323,13 +323,13 @@ build_diff() {
tmpdir=gccdiff.$$
mkdir $tmpdir || error "Could not create directory $tmpdir"
changedir $tmpdir
- ${TAR} xfz $1 || error "Could not unpack $1 for diffs"
- ${TAR} xfz $3 || error "Could not unpack $3 for diffs"
- ${DIFF} $2 $4 > ../${5%.gz}
+ (${BZIP2} -d -c $1 | ${TAR} xf - ) || error "Could not unpack $1 for diffs"
+ (${BZIP2} -d -c $3 | ${TAR} xf - ) || error "Could not unpack $3 for diffs"
+ ${DIFF} $2 $4 > ../${5%.bz2}
if [ $? -eq 2 ]; then
error "Trouble making diffs from $1 to $3"
fi
- ${GZIP} ../${5%.gz} || error "Could not gzip ../${5%.gz}"
+ ${BZIP2} ../${5%.bz2} || error "Could not generate ../$5"
changedir ..
rm -rf $tmpdir
FILE_LIST="${FILE_LIST} $5"
@@ -446,13 +446,13 @@ SNAPSHOT=0
LOCAL=0
# Major operation modes.
-MODE_BZIP2=0
+MODE_GZIP=0
MODE_DIFFS=0
MODE_SOURCES=0
MODE_TARFILES=0
MODE_UPLOAD=0
-# .gz files generated to create .bz2 files from.
+# List of archive files generated; used to create .gz files from .bz2.
FILE_LIST=""
# Programs we use.
@@ -546,7 +546,7 @@ else
LAST_DATE=`cat ~/.snapshot_date`
LAST_LONG_DATE=`date --date=$LAST_DATE +%Y-%m-%d`
LAST_DIR=~ftp/pub/gcc/snapshots/${LAST_LONG_DATE}
- OLD_TARS=${LAST_DIR}/gcc-${LAST_DATE}.tar.gz
+ OLD_TARS=${LAST_DIR}/gcc-${LAST_DATE}.tar.bz2
fi
fi
@@ -583,12 +583,12 @@ export TZ
# Handle the major modes.
while [ $# -ne 0 ]; do
case $1 in
- bzip2) MODE_BZIP2=1;;
diffs) MODE_DIFFS=1;;
+ gzip) MODE_GZIP=1;;
sources) MODE_SOURCES=1;;
tarfiles) MODE_TARFILES=1;;
upload) MODE_UPLOAD=1;;
- all) MODE_SOURCES=1; MODE_TARFILES=1; MODE_DIFFS=1; MODE_BZIP2=1; MODE_UPLOAD=1;;
+ all) MODE_SOURCES=1; MODE_TARFILES=1; MODE_DIFFS=1; MODE_GZIP=1; MODE_UPLOAD=1;;
*) error "Unknown mode $1";;
esac
shift
@@ -617,9 +617,9 @@ if [ $MODE_DIFFS -ne 0 ]; then
fi
fi
-# Build bzip2 files
-if [ $MODE_BZIP2 -ne 0 ]; then
- build_bzip2
+# Build gzip files
+if [ $MODE_GZIP -ne 0 ]; then
+ build_gzip
fi
# Upload them to the FTP server.
More information about the Gcc-patches
mailing list