From b3d373cc83ebdfd6ee9413bee57f2f86d09d1820 Mon Sep 17 00:00:00 2001 From: Rafael Monnerat <rafael@nexedi.com> Date: Tue, 11 Sep 2012 01:09:26 +0200 Subject: [PATCH] Remove useless utility scripts from old svn times. --- product/ERP5/bin/build_bt5_from_svn.sh | 81 --------------------- product/ERP5/bin/build_products_from_svn.sh | 70 ------------------ product/ERP5/utils/svn_update.sh | 72 ------------------ 3 files changed, 223 deletions(-) delete mode 100755 product/ERP5/bin/build_bt5_from_svn.sh delete mode 100755 product/ERP5/bin/build_products_from_svn.sh delete mode 100755 product/ERP5/utils/svn_update.sh diff --git a/product/ERP5/bin/build_bt5_from_svn.sh b/product/ERP5/bin/build_bt5_from_svn.sh deleted file mode 100755 index 3360cd11f6..0000000000 --- a/product/ERP5/bin/build_bt5_from_svn.sh +++ /dev/null @@ -1,81 +0,0 @@ -#! /bin/bash -# -# Usage: build_bt5_from_svn.sh [-p path] [-d dir] -# -# The path is the last part of the svn root, for example, tag/5.0 or trunk. -# By default, the path is "trunk". -# -# The dir is the destination directory where the repository is made. -# By default, the dir is the current directory. - -set -e - -path=trunk -repository=$(pwd) - -while getopts "p:d:" opt; do - case $opt in - p) path="$OPTARG" ;; - d) repository="$OPTARG" ;; - esac -done - -# Lock file name -LOCKFILE="/tmp/$(basename $0).lock" -# SVN paths -SVNROOT="https://svn.erp5.org/repos/public/erp5/$path" -# 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 SVN copies -BASELOCALDIR="/tmp" -LOCALDIR="$BASELOCALDIR/$$" -# Local directory to receive butiness templates -BT5DIR="$repository" - - -function cleanup { - rm -f "$LOCKFILE" - rm -rf "$LOCALDIR" -} - -if [ -e "$LOCKFILE" ]; then - echo "Lock file '$LOCKFILE' exists, exiting..." - exit 1 -fi - -trap "cleanup" ERR - -touch "$LOCKFILE" -mkdir "$LOCALDIR" - -for MODULE in $MODULES; do - # Checkout the source code from svn - cd "$LOCALDIR" - svn co "$SVNROOT/$MODULE" > /dev/null - 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" - fi - done -done - -# Get the latest version of the genbt5list and generate the index -cd "$LOCALDIR" -svn co "$SVNROOT/$GENBTLIST" > /dev/null - -# Publish the repository -mv -f "$LOCALDIR/"*.bt5 "$BT5DIR" - -# Generate the index from repository directory, in case there are BT5 manually added there -cd "$BT5DIR" -/usr/bin/python "$LOCALDIR/`basename $GENBTLIST`/genbt5list" > /dev/null -chmod go+r bt5list - -# Clean up -cleanup diff --git a/product/ERP5/bin/build_products_from_svn.sh b/product/ERP5/bin/build_products_from_svn.sh deleted file mode 100755 index 922c5da272..0000000000 --- a/product/ERP5/bin/build_products_from_svn.sh +++ /dev/null @@ -1,70 +0,0 @@ -#! /bin/bash -# -# Usage: build_products_from_svn.sh [-p path] [-d dir] -# -# The path is the last part of the svn root, for example, tag/5.0 or trunk. -# By default, the path is "trunk". -# -# The dir is the destination directory where the repository is made. -# By default, the dir is the current directory. - -set -e - -path=trunk -repository=$(pwd) - -while getopts "p:d:" opt; do - case $opt in - p) path="$OPTARG" ;; - d) repository="$OPTARG" ;; - esac -done - -# Lock file name -LOCKFILE="/tmp/$(basename $0).lock" -# SVN paths -SVNROOT="https://svn.erp5.org/repos/public/erp5/$path" -# Relative svn paths to fetch -MODULES="products" -# Local directory to receive SVN copies -BASELOCALDIR="/tmp" -LOCALDIR="$BASELOCALDIR/$$" -# Local directory to receive products -PRODUCTSDIR="$repository" - - -function cleanup { - rm -f "$LOCKFILE" - rm -rf "$LOCALDIR" -} - -if [ -e "$LOCKFILE" ]; then - echo "Lock file '$LOCKFILE' exists, exiting..." - exit 1 -fi - -trap "cleanup" ERR - -touch "$LOCKFILE" -mkdir "$LOCALDIR" - -for MODULE in $MODULES; do - # Checkout the source code from svn - cd "$LOCALDIR" - svn co "$SVNROOT/$MODULE" > /dev/null - BMODULE=`basename "$MODULE"` - - # Create one archive for each Business Template - cd "$LOCALDIR/$BMODULE" - for PRODUCT in `ls "$LOCALDIR/$BMODULE"`; do - if [ -d "$LOCALDIR/$BMODULE/$PRODUCT" ]; then - tar -zcf "$LOCALDIR/$PRODUCT.tgz" --exclude .svn "$PRODUCT" - fi - done -done - -# Publish the repository -mv -f "$LOCALDIR/"*.tgz "$PRODUCTSDIR" - -# Clean up -cleanup diff --git a/product/ERP5/utils/svn_update.sh b/product/ERP5/utils/svn_update.sh deleted file mode 100755 index 312df12412..0000000000 --- a/product/ERP5/utils/svn_update.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -echo -e "\033[0;31mThis is an unsupported script. You should use 'svn update' command instead\033[0m" - -# Modules to get from the SVN -PRODUCTS="CMFActivity CMFCategory ERP5 ERP5Banking ERP5Catalog \ - ERP5Form ERP5OOo ERP5Security ERP5VCS ERP5SyncML \ - ERP5Type TimerService ZMySQLDDA 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 $p - else - svn checkout https://svn.erp5.org/repos/public/erp5/trunk/products/$p - fi - done - -# Get latests Business Templates -echo "" -echo "----- Updating Business Templates -----" -wget -nv -N --no-host-directories -r --cut-dirs=2 --level=2 --relative \ - --no-parent --accept=bt5,bt5list http://www.erp5.org/dists/snapshot/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 -- 2.30.9