#!/bin/bash repo=$1 into=$2 # Check whether this indeed looks like a local tree. if [ ! -f $into/gcc/version.c ]; then echo "This does not seem to be a GCC tree!" exit fi # Check for known version control systems. if [ -d $repo/.bzr ]; then GCC_GIT=${GCC_BZR-${BZR-bzr}} vcs_type="bzr" elif [ -d $repo/.svn ]; then GCC_SVN=${GCC_SVN-${SVN-svn}} vcs_type="svn" else echo "This does not seem to be a GCC GIT/Bzr tree!" exit fi rm -f $into/LAST_UPDATED $into/gcc/REVISION case $vcs_type in svn) revision=${REVNO:-`svn info $1 | awk '/Revision:/ { print $2 }'`} branch=`svn info $1 | sed -ne "/URL:/ { s,.*/trunk,trunk, s,.*/branches/,, s,.*/tags/,, p }"` ;; bzr) revision=${REVNO:-`bzr revno $repo`} branch=`bzr info $repo | grep "parent branch" | awk -F / '{ print $(NF-2) "/" $(NF-1); }'` ;; esac { date echo "`TZ=UTC date` (revision $revision)" } > $into/LAST_UPDATED echo "[$branch revision $revision]" > $into/gcc/REVISION