Discussion:
[Erp5-dev] [Erp5-report] r20672 - /erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh
Łukasz Nowak
2008-04-18 14:06:36 UTC
Permalink
Hello,

There is typo introduced in below commit. Patch attached.

Regards,
Luke

On 2008-04-18, 13:59:28
Author: yo
Date: Fri Apr 18 15:59:27 2008
New Revision: 20672
URL: http://svn.erp5.org?rev=20672&view=rev
Clean up, and add options to specify a svn root path and a
destination directory.
erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh
Modified: erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh
http://svn.erp5.org/erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh?rev=20672&r1=20671&r2=20672&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh (original) +++
erp5/trunk/products/ERP5/bin/build_bt5_from_svn.sh Fri Apr 18
+#! /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.
-# TODO: BT5 version support (stable/unstable)
+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"
+LOCKFILE="/tmp/$(basename $0).lock"
# SVN paths
-SVNROOT="https://svn.erp5.org/repos/public/erp5/trunk/"
+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 CVS copy
+# Local directory to receive SVN copies
BASELOCALDIR="/tmp"
+LOCALDIR="$BASELOCALDIR/$$"
# Local directory to receive butiness templates
-BT5DIR="/var/lib/zope/static/reposit/erp5/upload_module"
+BT5DIR="$repostiry"
-function cleanup () {
- rm -f $LOCKFILE
- exit 1
+
+function cleanup {
+ rm -f "$LOCKFILE"
+ rm -rf "$LOCALDIR"
}
if [ -e "$LOCKFILE" ]; then
@@ -25,37 +45,37 @@
exit 1
fi
-touch "$LOCKFILE" || exit 1
-LOCALDIR="$BASELOCALDIR/$$"
-mkdir "$LOCALDIR" || cleanup
+trap "cleanup" ERR
+
+touch "$LOCKFILE"
+mkdir "$LOCALDIR"
for MODULE in $MODULES; do
- # Checkout the source code from cvs
- cd "$LOCALDIR" || cleanup
- svn co "$SVNROOT$MODULE" > /dev/null || cleanup
+ # 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" || cleanup
+ tar -zcf "$LOCALDIR/$BT5.bt5" --exclude .svn "$BT5"
fi
done
done
# Get the latest version of the genbt5list and generate the index
-cd "$LOCALDIR" || cleanup
-svn co "$SVNROOT$GENBTLIST" > /dev/null || cleanup
+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" || cleanup
+cd "$BT5DIR"
/usr/bin/python "$LOCALDIR/`basename $GENBTLIST`/genbt5list"
/dev/null chmod go+r bt5list
# Clean up
-rm -rf $LOCALDIR
-rm -f $LOCKFILE
+cleanup
_______________________________________________
Erp5-report mailing list
Erp5-report at erp5.org
http://mail.nexedi.com/mailman/listinfo/erp5-report
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_bt5_from_svn.sh-typopatch
Type: application/octet-stream
Size: 365 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080418/1fc7def9/attachment.obj>
Yoshinori Okuji
2008-04-18 14:19:24 UTC
Permalink
Post by Łukasz Nowak
Hello,
There is typo introduced in below commit. Patch attached.
Thanks. I noticed it in 5 mins later. :)

YO
--
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org
Łukasz Nowak
2008-04-18 14:26:45 UTC
Permalink
On 2008-04-18, 16:19:24
Post by Yoshinori Okuji
Post by Łukasz Nowak
Hello,
There is typo introduced in below commit. Patch attached.
Thanks. I noticed it in 5 mins later. :)
Are you planning to split build_bt and build_product from
build_bt5/products as external scripts? If is it desirable I might try
to do it (as sometimes I need to build bt5 from checkouted directory).

Attached what we use.

Regards,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkbt5
Type: application/octet-stream
Size: 174 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080418/98ef8e95/attachment.obj>
Loading...