]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/blob - src/update-frescor-svn
RTEMS CPU: compilable with current version of CBS
[frescor/frsh-forb.git] / src / update-frescor-svn
1 #!/bin/sh
2
3 # Script to track FRESCOR SVN repositories. We do this in order not to
4 # diverge to much from the original code so that it can be easily
5 # joined in future if it will be necessary.
6
7 set -e
8
9 update() {
10     local dir=$1
11     local svnrepo=$2
12     cd $dir
13     echo "Updating $dir"
14     if ! git config --get  svn-remote.svn.url > /dev/null; then
15         git svn init $svnrepo
16     fi
17
18     git svn fetch
19     local gitbranch=`git show-ref --verify --hash refs/heads/frescor-svn`
20     local svnbranch=`git show-ref --verify --hash refs/remotes/git-svn`
21     
22     if [ -z "$gitbranch" ]; then
23         echo "  Creating frescor-svn branch"
24         git branch frescor-svn git-svn
25     else
26         if [ "$gitbranch" != "$svnbranch" ]; then
27             echo "  Merging SVN to branch frescor-svn"
28             git merge git-svn
29             git checkout master
30         else
31             echo "  Already up-to-date"
32         fi
33     fi
34     cd ..
35 }
36
37 update frsh-include http://www.frescor.org/private/svn/frescor/frsh/trunk/include
38 update fosa         http://www.frescor.org/private/svn/frescor/fosa/trunk
39 update fna          http://www.frescor.org/private/svn/frescor/fna/trunk