Commit 946a8546 authored by Jérome Perrin's avatar Jérome Perrin

the cvs server is no longuer used



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17293 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bbad3ba9
#!/bin/bash
# TODO: BT5 version support (stable/unstable)
# Lock file name
LOCKFILE="/tmp/`basename $0`.lock"
# CVS root
CVSROOT=":pserver:anonymous@cvs.erp5.org:/cvsroot"
# Module containing business template
MODULES="erp5_bt5 erp5_banking ERP5/bootstrap"
# Script generating the business template repository index (in $REPOSITORY)
GENBTLIST="ERP5/bin/genbt5list" # XXX: relative to the same repository
# Local directory to receive CVS copy
BASELOCALDIR="/tmp"
# Local directory to receive butiness templates
BT5DIR="/var/lib/zope/static/reposit/erp5/upload_module"
function cleanup () {
rm -f $LOCKFILE
exit 1
}
if [ -e "$LOCKFILE" ]; then
echo "Lock file '$LOCKFILE' exists, exiting..."
exit 1
fi
touch "$LOCKFILE" || exit 1
LOCALDIR="$BASELOCALDIR/$$"
mkdir "$LOCALDIR" || cleanup
for MODULE in $MODULES; do
# Checkout the source code from cvs
cd "$LOCALDIR" || cleanup
cvs -Qz3 "-d$CVSROOT" checkout "$MODULE" || cleanup
# Create one archive for each Business Template
cd "$LOCALDIR/$MODULE"
for BT5 in `ls "$LOCALDIR/$MODULE"`; do
if [ "$BT5" != "CVS" -a -d "$LOCALDIR/$MODULE/$BT5" ]; then
tar -zcf "$LOCALDIR/$BT5.bt5" --exclude CVS --exclude .cvsignore "$BT5" || cleanup
fi
done
done
# Get the latest version of the genbt5list and generate the index
cd "$LOCALDIR" || cleanup
cvs -Qz3 "-d$CVSROOT" checkout "$GENBTLIST" || cleanup
# Publish the repository
mv -f "$LOCALDIR/"*.bt5 "$BT5DIR"
# Generate the index from repository directory, in case there are BT5 manually added there
cd "$BT5DIR" || cleanup
/usr/bin/python "$LOCALDIR/$GENBTLIST" > /dev/null
chmod go+r bt5list
# Clean up
rm -rf $LOCALDIR
rm -f $LOCKFILE
#!/bin/bash
# Modules to get from the CVS
MODULES="CMFActivity CMFCategory ERP5 ERP5Catalog ERP5Form \
ERP5OOo ERP5Security ERP5SyncML ERP5Type ZSQLCatalog \
erp5_banking erp5_bt5"
# CVS Users name
CVS_USER="anonymous" #CVS_USER="seb"
ANON_CVS="anonymous"
# 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"
LOGGED=0
ZERO=0
export CVS_RSH=ssh
# Update each module
for f in $MODULES
do
echo ""
echo "----- Updating $f -----"
if ls $ZOPE_PRODUCTS/$f > /dev/null 2>&1 /dev/null; then
cd $ZOPE_PRODUCTS/$f && \
cvs update -RdPA && cd $ZOPE_PRODUCTS/
else
if [ $CVS_USER == $ANON_CVS ] ; then
if [ $LOGGED == $ZERO ] ; then
cvs -d:pserver:anonymous@cvs.erp5.org:/cvsroot login
cvs -z3 -d:pserver:anonymous@cvs.erp5.org:/cvsroot co -A $f
LOGGED=1
else
cvs -z3 -d:pserver:anonymous@cvs.erp5.org:/cvsroot co -A $f
fi
else
cvs -z3 -d $CVS_USER@cvs.erp5.org:/cvsroot co -A $f
fi
fi
done
# 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 "----- Symlink updated: $BASE/$SOURCE -> $DESTINATION"
fi
}
for f in $MODULES
do
if test $f = "ZSQLCatalog"; then
echo `update_symlink $EXTENSIONS_FOLDER zsqlbrain.py ../Products/ZSQLCatalog/zsqlbrain.py`
fi
if test $f = "ERP5"; then
echo `update_symlink $EXTENSIONS_FOLDER InventoryBrain.py ../Products/ERP5/Extensions/InventoryBrain.py`
fi
if test $f = "erp5_bt5"; then
echo `update_symlink $BT5_FOLDER erp5_bt5 ../Products/erp5_bt5`
fi
if test $f = "erp5_banking"; then
echo `update_symlink $BT5_FOLDER erp5_banking ../Products/erp5_banking`
fi
done
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment