4 echo "Copying stuff from skeleton"
6 for f
in $
(ls -A /vagrant
/skel
)
8 target
="/home/vagrant/$f"
11 echo "$target already there"
13 echo "Copying $target from skeleton"
14 cp -r "/vagrant/skel/$f" $target
18 OFDIR
=/home
/vagrant
/foam
/
21 chown
-R vagrant
:vagrant
$OFDIR
23 # for distros that don't have group vagrant
24 chown
-R vagrant
$OFDIR
26 OFClone
=$OFDIR/foam-extend-3.1
27 OFReference
=$OFClone-parent
29 OFParent
=/FOAM-sources
34 echo "Cloning the OF-sources"
36 if [ -e "$OFParent/.git" ]
40 echo "Cloning. This may take some time"
43 # su -c not correctly working on FreeBSD
44 su vagrant
- -c "git clone $OFParent $OFClone"
47 echo "Git cloned: TODO: set same branch as parent"
49 elif [ -e "$OFParent/.hg" ]
52 echo "Parent is mercurial. Hello Bernhard"
54 # branchName=`hg branch -R $OFParent`
55 idName
=`hg id -i -R $OFParent | sed -e "s/\+//"`
56 # sed removes + in case of a 'tainted' parent
58 echo "Parent is on id $idName"
59 echo "Cloning. This may take some time"
60 su vagrant
- -c "hg clone -u $idName $OFParent $OFClone"
64 echo "Problem. Parent $OFParent is neither git nor mercurial"
68 echo "Repository $OFClone already there. No cloning"
71 if [ ! -e $OFReference ]
74 echo "Linking $OFReference to $OFParent"
76 ln -s $OFParent $OFReference
79 echo "Link $OFReference already there"
83 chown
-R vagrant
:vagrant
$OFDIR
86 echo "Current ccache:"
87 export CCACHE_DIR
=/vagrant
/ccache4vm
; ccache
--show-stats