#!/bin/sh

echo -n "Syncing to debian chroot ... "
cp -rf . /home/woody-chroot/home/ondrejj/sagator/
find /home/woody-chroot/home/ondrejj/sagator/ -name 'CVS*' -exec rm -rf {} \; \
  2>/dev/null
echo "done"

make README.scanners

if [ "$1" = "virtual" ]; then
  TARGET='salstar.sk:sh/sagator'
else
  TARGET='sal:public_html/pub/antivir/sagator'
  EXTRA_EXCLUDE="--exclude=rsync --exclude=t.py"
fi

rsync -v \
 --archive --recursive --links --perms --times --delete -e ssh \
 --stats --progress \
 --exclude='config.py' \
 --exclude='DEADJOE' \
 --exclude='build/' --exclude='dist/' \
 --exclude='localconfig.py' \
 --exclude='*.py[co]' \
 --exclude='doc/' \
 --exclude='*~' \
 --exclude='setup.*' --exclude='rblcheck.*' \
 --exclude='snapshots/' \
 --exclude='CVS*' \
 --exclude='*.o' --exclude='*.so' \
 --include='config.py-*' \
 $EXTRA_EXCLUDE \
 . "$TARGET"

rsync -v \
 --archive --recursive --links --perms --times --delete -e ssh \
 --stats --progress \
 /home/woody-chroot/home/ondrejj/debian/ sal:public_html/pub/sagator/debian

[ "$1" = "noco" ] && exit
cvs commit
