Commit d2e18b9e authored by Vincent Pelletier's avatar Vincent Pelletier

genbt5list: Make proper use of stdout and stderr.

build_bt5_from_cvs.sh: Don't print useless stuff so it becomes crontab-able.
  Generate bt5 list from repository in case there are any BT5 added by someting else than this script.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5495 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 119cc046
...@@ -36,21 +36,21 @@ cvs -Qz3 "-d$CVSROOT" checkout "$MODULE" || cleanup ...@@ -36,21 +36,21 @@ cvs -Qz3 "-d$CVSROOT" checkout "$MODULE" || cleanup
# Create one archive for each Business Template # Create one archive for each Business Template
for BT5 in `ls "$LOCALDIR/$MODULE"`; do for BT5 in `ls "$LOCALDIR/$MODULE"`; do
if [ "$BT5" != "CVS" -a -d "$LOCALDIR/$MODULE/$BT5" ]; then if [ "$BT5" != "CVS" -a -d "$LOCALDIR/$MODULE/$BT5" ]; then
echo "Building $BT5..."
cd "$LOCALDIR/$MODULE/$BT5" || cleanup cd "$LOCALDIR/$MODULE/$BT5" || cleanup
tar -zcf "$LOCALDIR/$BT5.bt5" --exclude CVS --exclude .cvsignore . || cleanup tar -zcf "$LOCALDIR/$BT5.bt5" --exclude CVS --exclude .cvsignore . || cleanup
else
echo "Skipping $BT5"
fi fi
done done
# Get the latest version of the genbt5list and generate the index # Get the latest version of the genbt5list and generate the index
cd "$LOCALDIR" || cleanup cd "$LOCALDIR" || cleanup
cvs -Qz3 "-d$CVSROOT" checkout "$GENBTLIST" || cleanup cvs -Qz3 "-d$CVSROOT" checkout "$GENBTLIST" || cleanup
python "$GENBTLIST" || cleanup
# Publish the repository # Publish the repository
mv -f bt5list "$LOCALDIR/"*.bt5 "$BT5DIR" mv -f bt5list "$LOCALDIR/"*.bt5 "$BT5DIR" || cleanup
# Generate the index from repository directory, in case there are BT5 manually added there
cd "$BT5DIR" || cleanup
python "$LOCALDIR/$GENBTLIST" > /dev/null
# Clean up # Clean up
rm -rf $LOCALDIR rm -rf $LOCALDIR
......
...@@ -40,7 +40,12 @@ import shutil ...@@ -40,7 +40,12 @@ import shutil
property_list = ('title', 'version', 'description', 'license', 'dependency_list', 'copyright_list') property_list = ('title', 'version', 'description', 'license', 'dependency_list', 'copyright_list')
def info(message): def info(message):
"""Print a message. """Print a message to stdout.
"""
sys.stdout.write(message)
def err(message):
"""Print a message to stderr.
""" """
sys.stderr.write(message) sys.stderr.write(message)
...@@ -73,7 +78,7 @@ def generateInformation(fd): ...@@ -73,7 +78,7 @@ def generateInformation(fd):
try: try:
tar = tarfile.open(file, 'r:gz') tar = tarfile.open(file, 'r:gz')
except tarfile.TarError: except tarfile.TarError:
info('an error happened; skipping\n') err('An error happened in %s; skipping\n' % (file,))
continue continue
try: try:
property_dict = readBusinessTemplate(tar) property_dict = readBusinessTemplate(tar)
......
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