egcs_update (touch_files, [...]): New functions.

* egcs_update (touch_files, apply_patch): New functions.
        Use them.  New command-line option --patch.  Split test of local
        tree into two parts.  Add comments.

Co-Authored-By: Jerry Quinn <jquinn@nortelnetworks.com>

From-SVN: r27946
This commit is contained in:
Gerald Pfeifer 1999-07-05 12:22:15 +02:00 committed by Gerald Pfeifer
parent af07639171
commit 9d59f3071f
2 changed files with 88 additions and 39 deletions

View File

@ -1,3 +1,10 @@
1999-07-05 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
Jerry Quinn <jquinn@nortelnetworks.com>
* egcs_update (touch_files, apply_patch): New functions.
Use them. New command-line option --patch. Split test of local
tree into two parts. Add comments.
1999-07-03 Alexandre Oliva <oliva@dcc.unicamp.br>
* test_summary: If Target is `unix{*}', append the Target variants

View File

@ -9,14 +9,18 @@
# reads --nostdflags, $UPDATE_OPTIONS as well as this parameter itself
# are omitted.
#
# If the first parameter reads --patch, the second parameter is considered
# a patch file.
#
# Examples:
#
# contrib/egcs_update -r egcs_latest_snapshot
# contrib/egcs_update -A
# contrib/egcs_update --nostdflags -P -r egcs_1_1_branch gcc/testsuite
# contrib/egcs_update --patch some-patch
#
#
# (C) 1998 Free Software Foundation
# (C) 1998-1999 Free Software Foundation
# Originally by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, August 1998.
#
# This script is Free Software, and it can be copied, distributed and
@ -24,57 +28,21 @@
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
# Default options used when updating via CVS.
UPDATE_OPTIONS=-P
# Add -d to create any directories that exist in the repository but not
# locally.
# Add -A to reset any sticky tags, dates, or `-k' options.
echo "Current directory is `pwd`."
# First of all, check whether this indeed looks like a local CVS of egcs.
if [ ! -d CVS ] || [ ! -f gcc/version.c ]; then
echo "This does not seem to be an egcs CVS tree!"
exit
fi
# Check command-line options
if [ x"${1}"x = x"--nostdflags"x ]; then
shift
else
set -- $UPDATE_OPTIONS ${1+"$@"}
fi
echo "Pass 1: Updating autoconf and bison generated files"
# Do a CVS update on those files that exist in CVS directories. libg++
# makes sense to drop into the tree, but it isn't CVS-controlled.
X=`for i in \`find . -name configure.in -o -name '*.y'\`
do
D=\`dirname $i\`/CVS
if [ -f $i -a -d $D ]; then
echo $i
fi
done`
cvs -q update $X
if [ $? -ne 0 ]; then
echo "CVS update of generated files failed." >&2
exit 1
fi
echo "Pass 2: Updating full tree"
cvs -q update ${1+"$@"}
if [ $? -ne 0 ]; then
echo "CVS update of full tree failed." >&2
exit 1
fi
echo "Pass 3: Fixing local tree"
# This function touches generated files such that the ``end'' user does
# not have to rebuild them.
#
# Please also update the FAQ accordingly if you change the list of
# files below. Note that generated files should be touched only
# after the corresponding *.y files.
touch_files()
{
touch `find . -name configure -print`
touch `find texinfo -name Makefile.in -print`
touch `find texinfo -name \*.pot -print`
@ -104,3 +72,77 @@ do
touch $f
fi
done
}
# This functions applies a patch to an existing tree.
apply_patch()
{
if [ -f $1 ]; then
echo "Applying patch file $1"
case "$1" in
*gz)
gzip -d -c $1 | patch -p1 ;;
*)
cat $1 | patch -p1 ;;
esac
fi
echo "Updating file timestamps"
touch_files
}
# This is where the actual processing starts.
echo "Current directory is `pwd`."
# Check whether this indeed looks like a local tree.
if [ ! -f gcc/version.c ]; then
echo "This does not seem to be an egcs tree!"
exit
fi
# First of all, check whether we are going to process a patch.
if [ x"${1}"x = x"--patch"x ]; then
apply_patch ${2}
exit 0
fi
# Check whether this indeed looks like a local CVS tree.
if [ ! -d CVS ]; then
echo "This does not seem to be an egcs CVS tree!"
exit
fi
# Check command-line options
if [ x"${1}"x = x"--nostdflags"x ]; then
shift
else
set -- $UPDATE_OPTIONS ${1+"$@"}
fi
echo "Pass 1: Updating autoconf and bison generated files"
# Do a CVS update on those files that exist in CVS directories. libg++
# makes sense to drop into the tree, but it isn't CVS-controlled.
X=`for i in \`find . -name configure.in -o -name '*.y'\`
do
D=\`dirname $i\`/CVS
if [ -f $i -a -d $D ]; then
echo $i
fi
done`
cvs -q update $X
if [ $? -ne 0 ]; then
echo "CVS update of generated files failed." >&2
exit 1
fi
echo "Pass 2: Updating full tree"
cvs -q update ${1+"$@"}
if [ $? -ne 0 ]; then
echo "CVS update of full tree failed." >&2
exit 1
fi
echo "Pass 3: Fixing local tree"
touch_files