[Erp5-report] r6453 - /erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 4 17:07:27 CEST 2006


Author: vincent
Date: Tue Apr  4 17:07:25 2006
New Revision: 6453

URL: http://svn.erp5.org?rev=6453&view=rev
Log:
Add support for generation of a bt5 repository from an SVN repository.

Added:
    erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh   (with props)

Added: erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh?rev=6453&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh (added)
+++ erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh Tue Apr  4 17:07:25 2006
@@ -1,0 +1,61 @@
+#!/bin/bash
+
+# TODO: BT5 version support (stable/unstable)
+
+# Lock file name
+LOCKFILE="/tmp/`basename $0`.lock"
+# SVN paths
+SVNROOT="https://svn.erp5.org/repos/public/erp5/trunk/"
+# Relative svn paths to fetch
+MODULES="bt5 products/ERP5/bootstrap"
+# Script generating the business template repository index
+GENBTLIST="products/ERP5/bin"
+# 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
+  svn co "$SVNROOT$MODULE" > /dev/null || cleanup
+  BMODULE=`basename "$MODULE"`
+
+  # Create one archive for each Business Template
+  cd "$LOCALDIR/$BMODULE"
+  for BT5 in `ls "$LOCALDIR/$BMODULE"`; do
+    if [ -d "$LOCALDIR/$BMODULE/$BT5" ]; then
+      tar -zcf "$LOCALDIR/$BT5.bt5" --exclude .svn "$BT5" || cleanup
+    fi
+  done
+done
+
+# Get the latest version of the genbt5list and generate the index
+cd "$LOCALDIR" || cleanup
+svn co "$SVNROOT$GENBTLIST" > /dev/null || 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/`basename $GENBTLIST`/genbt5list" > /dev/null
+chmod go+r bt5list
+
+# Clean up
+rm -rf $LOCALDIR
+rm -f $LOCKFILE

Propchange: erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh
------------------------------------------------------------------------------
    svn:executable = *




More information about the Erp5-report mailing list