Commit 4a494092 authored by Simon Brass's avatar Simon Brass
Browse files

gcc-update.sh: add correct version numbering

parent f3df8a24
Pipeline #26 skipped
#!/bin/bash
set -x
FC_LABEL=$1
IGNORE_DIRS="boehm-gc gnattools libada libffi libjava libobjc gcc/ada gcc/java gcc/objc gcc/objcp gcc/testsuite"
GCC_SVN_URL="svn://gcc.gnu.org/svn/gcc"
GCC_NAME=${FC_LABEL//./_}
set +x
function new_working_copy {
local $DIR=$1
svn checkout ${GCC_SVN_URL}/${DIR}
for ignore in $IGNORE_DIRS; do
svn update --set-depth empty $SVN_SUBDIR/${ignore}
done
}
function update_working_copy {
local $DIR=$1
svn update $DIR
}
set -x
case $FC_LABEL in
gcc-trunk )
SVN_DIR=""
SVN_SUBDIR=trunk
SVN_REVISION=0;;
gcc-[0-9].[0-9].[0-9] )
SVN_DIR=tags
SVN_SUBDIR=${GCC_NAME/-/_}_release
SVN_REVISION=-1;;
gcc-[0-9].[1-9] )
SVN_DIR=branches
SVN_SUBDIR=${GCC_NAME}-branch
SVN_REVISION=0;;
gcc-[0-9].0 )
SVN_DIR=branches
SVN_SUBDIR=${GCC_NAME//_0/}-branch
SVN_REVISION=0;;
* )
echo "error: don't know label $FC_LABEL"
exit 1
esac
set +x
if [[ -d "$SVN_SUBDIR" ]]
then
echo Updating existing working copy...
update_working_copy ${SVN_DIR}/${SVN_SUBDIR}
else
echo Working copy not found. Creating new working copy...
new_working_copy ${SVN_DIR}/${SVN_SUBDIR}
fi
if [[ "$SVN_REVISION" -eq 0 ]]
then
SVN_REVISION=`svn info $SVN_SUBDIR | grep Revision | grep -o -E [0123456789]+`
BUILD_DIR=${FC_LABEL}-${SVN_REVISION}
else
BUILD_DIR=${FC_LABEL}
fi
echo done.
echo creating archiv $BUILD_DIR.tar.bz2 ...
svn export $SVN_SUBDIR $BUILD_DIR
rm -rf *.tar.bz2
tar cjf $BUILD_DIR.tar.bz2 $BUILD_DIR
rm -rf $BUILD_DIR
echo everything is done.
Supports Markdown
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