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
15 chown
-R vagrant
:vagrant
$target
19 OFDIR
=/home
/vagrant
/foam
/
21 # make sure that a symbolic link is not erased
22 if [ ! -e $OFDIR ]; then
23 echo "Making directory $OFDIR"
27 chown
-R vagrant
:vagrant
$OFDIR
29 # for distros that don't have group vagrant
30 chown
-R vagrant
$OFDIR
32 OFClone
=$OFDIR/foam-extend-3.2
33 OFReference
=$OFClone-parent
35 OFParent
=/FOAM-sources
40 echo "Cloning the OF-sources"
42 if [ -e "$OFParent/.git" ]
46 echo "Cloning. This may take some time"
49 # su -c not correctly working on FreeBSD
50 su
- vagrant
-c "git clone $OFParent $OFClone"
53 echo "Git cloned: TODO: set same branch as parent"
55 elif [ -e "$OFParent/.hg" ]
58 echo "Parent is mercurial. Hello Bernhard"
60 # branchName=`hg branch -R $OFParent`
61 idName
=`hg id -i -R $OFParent | sed -e "s/\+//"`
62 # sed removes + in case of a 'tainted' parent
64 echo "Parent is on id $idName"
65 echo "Cloning. This may take some time"
66 su
- vagrant
-c "hg clone -u $idName $OFParent $OFClone"
70 echo "Problem. Parent $OFParent is neither git nor mercurial"
74 echo "Repository $OFClone already there. No cloning"
77 if [ ! -e $OFReference ]
80 echo "Linking $OFReference to $OFParent"
82 ln -s $OFParent $OFReference
85 echo "Link $OFReference already there"
89 chown
-R vagrant
:vagrant
$OFDIR
92 echo "Current ccache:"
93 export CCACHE_DIR
=/vagrant
/ccache4vm
; ccache
--show-stats