Commit 44d952b3 by Gerald Pfeifer Committed by Gerald Pfeifer

gcc_release (build_tarfile): Build .bz2 files instead of .gz files.

	* 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.

From-SVN: r68074
parent 97587cfa
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.
2003-06-14 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> 2003-06-14 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* snapshot-README: Use GCC instead of gcc, C++ front end instead of * snapshot-README: Use GCC instead of gcc, C++ front end instead of
......
...@@ -245,11 +245,11 @@ EOF ...@@ -245,11 +245,11 @@ EOF
build_tarfile() { build_tarfile() {
# Get the name of the destination tar file. # Get the name of the destination tar file.
TARFILE="$1.tar.gz" TARFILE="$1.tar.bz2"
shift shift
# Build the tar file itself. # Build the tar file itself.
(${TAR} cf - "$@" | ${GZIP} > ${TARFILE}) || \ (${TAR} cf - "$@" | ${BZIP2} > ${TARFILE}) || \
error "Could not build tarfile" error "Could not build tarfile"
FILE_LIST="${FILE_LIST} ${TARFILE}" FILE_LIST="${FILE_LIST} ${TARFILE}"
} }
...@@ -288,11 +288,11 @@ build_tarfiles() { ...@@ -288,11 +288,11 @@ build_tarfiles() {
`basename ${SOURCE_DIRECTORY}` `basename ${SOURCE_DIRECTORY}`
} }
# Build .bz2 files. # Build .gz files.
build_bzip2() { build_gzip() {
for f in ${FILE_LIST}; do for f in ${FILE_LIST}; do
bzfile=${f%.gz}.bz2 target=${f%.bz2}.gz
(zcat $f | ${BZIP2} > ${bzfile}) || error "Could not create ${bzfile}" (${BZIP2} -d -c $f | ${GZIP} > ${target}) || error "Could not create ${target}"
done done
} }
...@@ -300,19 +300,19 @@ build_bzip2() { ...@@ -300,19 +300,19 @@ build_bzip2() {
build_diffs() { build_diffs() {
old_dir=${1%/*} old_dir=${1%/*}
old_file=${1##*/} old_file=${1##*/}
old_vers=${old_file%.tar.gz} old_vers=${old_file%.tar.bz2}
old_vers=${old_vers#gcc-} old_vers=${old_vers#gcc-}
inform "Building diffs against version $old_vers" 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 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 old_tar=${old_dir}/${f}-${old_vers}.tar.bz2
new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.gz new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.bz2
if [ ! -e $old_tar ]; then if [ ! -e $old_tar ]; then
inform "$old_tar not found; not generating diff file" inform "$old_tar not found; not generating diff file"
elif [ ! -e $new_tar ]; then elif [ ! -e $new_tar ]; then
inform "$new_tar not found; not generating diff file" inform "$new_tar not found; not generating diff file"
else else
build_diff $old_tar gcc-${old_vers} $new_tar gcc-${RELEASE} \ build_diff $old_tar gcc-${old_vers} $new_tar gcc-${RELEASE} \
${f}-${old_vers}-${RELEASE}.diff.gz ${f}-${old_vers}-${RELEASE}.diff.bz2
fi fi
done done
} }
...@@ -323,13 +323,13 @@ build_diff() { ...@@ -323,13 +323,13 @@ build_diff() {
tmpdir=gccdiff.$$ tmpdir=gccdiff.$$
mkdir $tmpdir || error "Could not create directory $tmpdir" mkdir $tmpdir || error "Could not create directory $tmpdir"
changedir $tmpdir changedir $tmpdir
${TAR} xfz $1 || error "Could not unpack $1 for diffs" (${BZIP2} -d -c $1 | ${TAR} xf - ) || error "Could not unpack $1 for diffs"
${TAR} xfz $3 || error "Could not unpack $3 for diffs" (${BZIP2} -d -c $3 | ${TAR} xf - ) || error "Could not unpack $3 for diffs"
${DIFF} $2 $4 > ../${5%.gz} ${DIFF} $2 $4 > ../${5%.bz2}
if [ $? -eq 2 ]; then if [ $? -eq 2 ]; then
error "Trouble making diffs from $1 to $3" error "Trouble making diffs from $1 to $3"
fi fi
${GZIP} ../${5%.gz} || error "Could not gzip ../${5%.gz}" ${BZIP2} ../${5%.bz2} || error "Could not generate ../$5"
changedir .. changedir ..
rm -rf $tmpdir rm -rf $tmpdir
FILE_LIST="${FILE_LIST} $5" FILE_LIST="${FILE_LIST} $5"
...@@ -446,13 +446,13 @@ SNAPSHOT=0 ...@@ -446,13 +446,13 @@ SNAPSHOT=0
LOCAL=0 LOCAL=0
# Major operation modes. # Major operation modes.
MODE_BZIP2=0 MODE_GZIP=0
MODE_DIFFS=0 MODE_DIFFS=0
MODE_SOURCES=0 MODE_SOURCES=0
MODE_TARFILES=0 MODE_TARFILES=0
MODE_UPLOAD=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="" FILE_LIST=""
# Programs we use. # Programs we use.
...@@ -546,7 +546,7 @@ else ...@@ -546,7 +546,7 @@ else
LAST_DATE=`cat ~/.snapshot_date` LAST_DATE=`cat ~/.snapshot_date`
LAST_LONG_DATE=`date --date=$LAST_DATE +%Y-%m-%d` LAST_LONG_DATE=`date --date=$LAST_DATE +%Y-%m-%d`
LAST_DIR=~ftp/pub/gcc/snapshots/${LAST_LONG_DATE} 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
fi fi
...@@ -583,12 +583,12 @@ export TZ ...@@ -583,12 +583,12 @@ export TZ
# Handle the major modes. # Handle the major modes.
while [ $# -ne 0 ]; do while [ $# -ne 0 ]; do
case $1 in case $1 in
bzip2) MODE_BZIP2=1;;
diffs) MODE_DIFFS=1;; diffs) MODE_DIFFS=1;;
gzip) MODE_GZIP=1;;
sources) MODE_SOURCES=1;; sources) MODE_SOURCES=1;;
tarfiles) MODE_TARFILES=1;; tarfiles) MODE_TARFILES=1;;
upload) MODE_UPLOAD=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";; *) error "Unknown mode $1";;
esac esac
shift shift
...@@ -617,9 +617,9 @@ if [ $MODE_DIFFS -ne 0 ]; then ...@@ -617,9 +617,9 @@ if [ $MODE_DIFFS -ne 0 ]; then
fi fi
fi fi
# Build bzip2 files # Build gzip files
if [ $MODE_BZIP2 -ne 0 ]; then if [ $MODE_GZIP -ne 0 ]; then
build_bzip2 build_gzip
fi fi
# Upload them to the FTP server. # Upload them to the FTP server.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment