blob: 6949e388a132151587c9024709890382da86325a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#!/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
|