diff --git a/product/ERP5/utils/svn_update.sh b/product/ERP5/utils/svn_update.sh new file mode 100755 index 0000000000000000000000000000000000000000..745f115a9984ee32eac5b0b292ee3c740ae9a92c --- /dev/null +++ b/product/ERP5/utils/svn_update.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# Modules to get from the SVN +PRODUCTS="CMFActivity CMFCategory ERP5 ERP5Catalog ERP5Form \ + ERP5OOo ERP5Security ERP5SyncML ERP5Type ZSQLCatalog" + +# System user and group that own Zope product files +USER="zope" +GROUP="zope" + +# Define paths +ZOPE_PRODUCTS="/var/lib/zope/Products" +EXTENSIONS_FOLDER="/var/lib/zope/Extensions" +BT5_FOLDER="/var/lib/zope/bt5" + +# Update each product +for p in $PRODUCTS + do + echo "" + echo "----- Updating $p -----" + if ls $ZOPE_PRODUCTS/$p > /dev/null 2>&1 /dev/null; then + svn update --non-interactive $p + else + svn checkout --non-interactive https://svn.erp5.org/repos/public/erp5/trunk/products/$p + fi + done + +# Get latests Business Templates +echo "" +echo "----- Updating Business Templates -----" +wget -nv --no-clobber --no-host-directories -r --level=2 --relative --no-parent --accept=bt5,bt5list http://torrent.erp5.org/bt5/ +rm -f robots.txt + +# Restore good right +chown -R $USER.$GROUP . + +# Replace symlinks installed by the default ERP5 installation by the new ones +update_symlink() { + BASE=$1 + SOURCE=$2 + DESTINATION=$3 + # If a previous symlink exist delete it + cd $BASE + if test -h $SOURCE; then + rm -f $SOURCE + fi + # If there is no $SOURCE file, create a symlink + if [ ! -e $SOURCE ]; then + ln -s $DESTINATION + echo "" + echo "----- Symlink updated: $BASE/$SOURCE -> $DESTINATION" + fi +} + +for p in $PRODUCTS + do + if test $p = "ZSQLCatalog"; then + echo `update_symlink $EXTENSIONS_FOLDER zsqlbrain.py ../Products/ZSQLCatalog/zsqlbrain.py` + fi + if test $p = "ERP5"; then + echo `update_symlink $EXTENSIONS_FOLDER InventoryBrain.py ../Products/ERP5/Extensions/InventoryBrain.py` + fi + if test $p = "bt5"; then + echo `update_symlink $BT5_FOLDER erp5_bt5 ../Products/bt5` + fi + done + +exit 0 \ No newline at end of file