Some hacks for missing extensions and XP:
[core.git] / setup-repos.sh
1 #!/bin/sh
2 # A little helper script of mine to setup a new development check-out directory.
3 # This script should be called where you want to create the repository and 'core'
4 # must be in the same directory. This script is public domain, if it blows up
5 # your washing maschine or your refrigerator stops working, this script is maybe
6 # not responsible for this, ask your trusted electrican. Use it on your own risk.
7
8 if test "${1}" == ""; then
9         echo "Usage: ${0} <repos> Setup given repository locally."
10         exit
11 elif test -e "${1}/.svn/"; then
12         echo "${0}: Repository ${1} is possibly setup! Aborting..."
13         exit
14 fi
15
16 echo "${0}: Checking out ${1} ..."
17 svn co "svn+ssh://www.mxchange.org/var/www/svn-repos/${1}/" || exit 255
18 cd "${1}"
19 echo "${0}: Creating base directories ..."
20 svn mkdir branches tags trunk || exit 255
21 cd trunk
22 echo "${0}: Updating skeleton ..."
23 svn up ../../skel/ || exit 255
24 echo "${0}: Importing skeleton repository ..."
25 svn export --force ../../skel/trunk/ . || exit 255
26 svn add * || exit 255
27 if test "${1}" != "admin"; then
28         echo "${0}: Adding directory application/${1} ..."
29         svn mkdir application/${1} || exit 255
30 else
31         echo "${0}: --- Not creating directory application/${1}. ---"
32 fi
33 echo "${0}: Linking to external 'core' repository ..."
34 svn propset svn:externals -F ../../core/trunk/svn-externals.txt . || exit 255
35 if (test "${1}" != "admin" && test "${1}" != "install"); then
36         cd application/
37         if test "${1}" != "qa"; then
38                 svn propset svn:externals -F ../../../core/trunk/application-external.txt . || exit 255
39         else
40                 svn propset svn:externals "admin http://www.ship-simu.org/repos/admin/trunk/application/admin/ 
41 install http://www.ship-simu.org/repos/install/trunk/application/install/" . || exit 255
42         fi
43         cd .. # trunk
44 else
45         echo "${0}: --- Not setting admin/install external source. ---"
46 fi
47 cd .. # root
48 echo "${0}: Running commit ..."
49 svn commit -m "Initial import with linked core from skeleton" || exit 255
50 echo "${0}: Updating ..."
51 svn up
52 echo "${0}: Exporting repositiory ..."
53 svn export --force trunk/ /var/www/htdocs/${1}
54 cd .. # start
55 echo "${0}: All done."