Release note export to HTML/TXT
[foam-extend-3.2.git] / vagrantSandbox / initGeneralScript.sh
blob086fdf1edf2422cde29aa6d39488ea3d532f2f39
1 #! /usr/bin/env bash
3 echo
4 echo "Copying stuff from skeleton"
5 echo
6 for f in $(ls -A /vagrant/skel)
7 do
8 target="/home/vagrant/$f"
9 if [ -e $target ]
10 then
11 echo "$target already there"
12 else
13 echo "Copying $target from skeleton"
14 cp -r "/vagrant/skel/$f" $target
16 done
18 OFDIR=/home/vagrant/foam/
20 mkdir -vp $OFDIR
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
31 if [ ! -e $OFClone ]
32 then
33 echo
34 echo "Cloning the OF-sources"
35 echo
36 if [ -e "$OFParent/.git" ]
37 then
38 echo
39 echo "Parent is git"
40 echo "Cloning. This may take some time"
41 echo
43 # su -c not correctly working on FreeBSD
44 su vagrant - -c "git clone $OFParent $OFClone"
46 echo
47 echo "Git cloned: TODO: set same branch as parent"
48 echo
49 elif [ -e "$OFParent/.hg" ]
50 then
51 echo
52 echo "Parent is mercurial. Hello Bernhard"
53 echo
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"
61 echo
62 else
63 echo
64 echo "Problem. Parent $OFParent is neither git nor mercurial"
65 echo
67 else
68 echo "Repository $OFClone already there. No cloning"
71 if [ ! -e $OFReference ]
72 then
73 echo
74 echo "Linking $OFReference to $OFParent"
75 echo
76 ln -s $OFParent $OFReference
77 else
78 echo
79 echo "Link $OFReference already there"
80 echo
83 chown -R vagrant:vagrant $OFDIR
85 echo
86 echo "Current ccache:"
87 export CCACHE_DIR=/vagrant/ccache4vm; ccache --show-stats